BUG! Relationship gets deleted if related posts are both "draft"

Support MB Relationships BUG! Relationship gets deleted if related posts are both "draft"Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27375
    MauroMauro
    Participant

    I have a relationship Hotels to Rooms.

    • Hotel object is in draft
    • I go and create a room and add the hotel to the related hotels list.
    • I save the room draft
    • I go to the hotel and make a change
    • I save the hotel draft

    The relationship is wiped out.

    This only happens if both the Room and the Hotel are in draft. If one of them is published the relationship stays there.

    Can you look into this?

    #27378
    MauroMauro
    Participant

    I figured this one out. I need to add this to both "from" and "to" in the relationship:

    'query_args' => array('post_status'=>'any')

    I think this is a design flaw of how the plugin works. In the back end it should show the relationship even if the corresponding post is in draft, pending review or in private, otherwise results will be unpredictable upon publishing.

    Following a revised logic, the listing of related objects in the back end should list all related objects along with:
    - the post title,
    - its status and
    - a link to go view the related post
    - a link to edit the post

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.