Bug: Related Records will Not Save When CPT Slug Is Updated and View is Not

Support MB Relationships Bug: Related Records will Not Save When CPT Slug Is Updated and View is Not

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44953
    saintsaint
    Participant

    Hi,

    I'd like to report a bug. This is an issue I figured out and fixed, so would like to let the team know for replication and resolution purposes, and others if they run into the same problem.

    If you change the slug of a CPT, and it is used in MB Relationships, what will happen is even if you update the Post to the new slug and save, _without_ changing the name of the MB Relationship name, I have found if you try and re-connect the related record, it will not save.

    In addition, if you use an MB View that uses that MB Relationship, it will cause a critical error on the page that it's used.

    The fix is two-fold:

    First, comment out the query in MB View that uses anything that related to the MB Relationship so that it will not throw a critical error.

    Second, rename the MB Relationship to something else and save it.

    Then you should be able to connect the related record again. Afterwards, you can rename the MB Relationship back to the original name and the related records should remain saved.

    Afterwards, go back and update the MB View with the updated CPT slug in the queries and you should be good to go.

    Hope this helps someone.

    #44961
    PeterPeter
    Moderator

    Hello,

    Thank you for your feedback.

    I'm checking the case and escalate it to the development team. However, changing the CPT slug is not a regular case and might cause many potential issues, not with just Meta Box plugins.

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