Fields with same ID bug?

Support General Fields with same ID bug?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2430
    totalmarctotalmarc
    Participant

    Since the last update or so you can no longer have multiple registered metaboxes (each with their own unique ID) and have fields with the same ID in those metaboxes.

    Before this worked fine but noticed this no longer works, fields have to have a unique ID even if they are in different metaboxes.

    Can you confirm this is a bug?

    #2431
    Anh TranAnh Tran
    Keymaster

    Hi,

    Currently, we have an internal caching mechanism, that will get all fields (by ID) and store in a static variable. This caching mechanism allows us to speed up the rwmb_meta function. Due to field ID is used as the key in the cache, field ID must be unique.

    However, as you said, there can be a situation that 2 post type can have a similar meta box where fields can have the same ID. Therefore, the helper function doesn't know which field it should get meta value for.

    I have just pushed a fixed for this on Github, please try and let me know if it works for you:

    https://github.com/rilwis/meta-box/commit/747375eb1d08176ace49c954de2b8d4a9d1d43d5

    #2437
    totalmarctotalmarc
    Participant

    Applied changes, and it didn't work.

    I reverted back to a standard Meta Box 4.8.3 and after some research it seems I only have this issue with the Image Advanced field type. So far it looks like other field types with the same ID work ok.

    If you register multiple meta boxes with unique ID, with a field type image_advanced with the same ID, changes are not saved when updating a page.

    Can you confirm this?

    #2444
    Anh TranAnh Tran
    Keymaster

    Can you post the code to register meta boxes? I want to test that.

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Fields with same ID bug?’ is closed to new replies.