Post status – edit & save
This topic contains 9 replies, has 3 voices, and was last updated by Kiran 5 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
March 12, 2019 at 10:43 am #474136
Hi, just wanted to check my understanding on post status and saving, based on my observations, is this expected behaviour:
1. If a post is opened in admin using EDIT and then published from the post page, then the validations for required fields are done, and post cannot be saved/published unless required fields are completed.
2. However using “Quick edit’ from the post list, and then saving the post after changing status from ‘pending’ to ‘published’, then even incomplete required fields are allowed and the post is published (ie the validations are skipped)
3. If import is used and post is published directly by setting the post_status field as “publish”, then also mandatory fields are not checked and post is published
3a. However, if the geo fields are missing lat/long then the import fails and the listing is not added.Are my observations correct as per expected behaviour?
thanks,
VivekMarch 12, 2019 at 5:03 pm #474188Hi,
what you described sounds right, however I asked to a developer to double checkand he’ll confirm or not asap.
Thanks
March 13, 2019 at 9:59 am #474300Hello Vivek,
Things you mentioned are allowed for admin users only. This is normal behavior because why admin leave invalid values there, admin should use expected values.
Kiran
March 13, 2019 at 10:10 am #474301Thanks, Paolo & Kiran. In the ideal world, yes- i completely agree with you. However, admins being human are also known to make mistakes, which the validations should ideally check.
On imports, i do not expect there to be validations, but had expected the behaviour of EDIT and QUICK EDIT to be similar (ie quick edit would also show an error message if validations failed, prompting the admin to open/edit the listing. – if the admin does quick edit, and hence does not see blank fields yet can publish the post.
March 13, 2019 at 10:16 am #474302I don’t understand why admin will leave values blank when going to edit. If admin finds he saved blank values then he can edit again and fill correct values. In Quick Edit only few fields are allowed like title, category, tag etc. Even WordPress default post does not have validation in Quick Edit. 🙂
March 13, 2019 at 10:27 am #474303Sure, I understand that WP also has the same issue, and am not challenging this at all.
In my case, i have multiple packages (say package B has additional fields, including some mandatory fields like say business ID, which package A does not have). Say, a general user adds a listing in package A, which is claimed by a business user in package B (paid) and after payment it goes into pending status.
Admin approves the claim and then has to also publish the post- now if admin does EDIT then they cannot save the listing without the mandatory business ID as required in package B. If they publish the post using quick edit the required info is missed and the listing is published. So then there is need for communication and manually changing the status to draft.Anyway, there are workarounds and with some caution and discipline should not cause many issues. Thanks!
March 13, 2019 at 10:43 am #474304While on the topic, there is a setting for listing status after payment in made (in the CPT package settings). It would be nice if this could distinguish between payment for addlisting or for claim.
Post payment for add listing, i may want to have the listing in pending, as user has already submitted, and only admin approval is requriedHowever after payment for claim, the business user would quite likely want to edit the listing to complete/correct the info provided by a general user. But the business user cannot edit the post until admin manually puts it into draft.
So in this case, one may want to set post payment status for addlisting as “pending” and for claim as ‘draft’March 13, 2019 at 2:26 pm #474333Hello,
In this case, one may want to set post payment status for addlisting as “pending” and for claim as ‘draft’
This can be achieved via using hook.
$data = apply_filters( 'geodir_pricing_complete_package_update_post_data', $data, $post_id, $package_id, $post_package_id, $revision_id );
Kiran
March 14, 2019 at 10:11 am #474472Thanks very much for this, Kiran.
As I am not a developer myself, to set this up shall I need to get a developer to do this, or are there any steps for me to do this myself?
thanks,
VivekMarch 14, 2019 at 1:59 pm #474491This reply has been marked as private. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket