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

  • Creator
  • #27375
    Resolved Mauro

    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?

Viewing 1 replies (of 1 total)
  • Author
  • #27378

    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 1 replies (of 1 total)
  • You must be logged in to reply to this topic.