Post status – edit & save

This topic contains 9 replies, has 3 voices, and was last updated by  Kiran 5 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #474136

    vivek
    Full Member
    Post count: 246

    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,
    Vivek

    #474188

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    what you described sounds right, however I asked to a developer to double checkand he’ll confirm or not asap.

    Thanks

    #474300

    Kiran
    Moderator
    Post count: 7069

    Hello 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

    #474301

    vivek
    Full Member
    Post count: 246

    Thanks, 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.

    #474302

    Kiran
    Moderator
    Post count: 7069

    I 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. 🙂

    #474303

    vivek
    Full Member
    Post count: 246

    Sure, 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!

    #474304

    vivek
    Full Member
    Post count: 246

    While 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 requried

    However 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’

    #474333

    Kiran
    Moderator
    Post count: 7069

    Hello,

    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

    #474472

    vivek
    Full Member
    Post count: 246

    Thanks 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,
    Vivek

    #474491

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket