MB Relationships mangles relationship ID when importing JSON

Support MB Relationships MB Relationships mangles relationship ID when importing JSON

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40587
    Eric CelesteEric Celeste
    Participant

    When I export a relationship field which has the id "artist_art" (note the underscore) to JSON, the JSON properly includes "id": "artist_art". However, when I import that same JSON using MB Relationships, the relationship field is created with the ID "artist-art" (note the hyphen). MB import is turning the underscore into a hyphen, or perhaps it is ignoring the id field entirely and recreating the id from other elements of the JSON.

    This can cause significant problems when there is pre-existing data in the database which has the original ID. MB Relationships should always use the id found in the JSON when importing relationships.

    This may be true of other MB importers as well, we have not yet tested the others. This would be less evident in other imports, though, since those IDs are not used to retrieve data as in the relationships. Still, on principle, if an ID is specified, then that ID should be used unless it is in conflict with another ID.

    #40600
    PeterPeter
    Moderator

    Hello Eric,

    Thanks for your feedback.

    I see that issue. The relationship ID is generated automatically from the relationship title (post title) so it uses the hyphen as the default separator. To fix this issue temporarily, you can just add the same title as ID artist_art and then export and import it.
    I've escalated this issue to the development team to fix it in the next update.

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