Possible Conflict with Map Custom Field

Support General Possible Conflict with Map Custom FieldResolved

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #38599
    UnakritiUnakriti
    Participant

    Hi Support,

    I have two custom field types Single Image and OSM Map on a standard WP Post. These work well on the backend - (1) users can upload an image and (2) set an address for the map to display - respectively,

    However, the map does not display on the same post when the Single Image is also shown. When I remove the Single Image display block, then the OSM map starts to display.

    Theme used for testing is Twenty Two Theme. I am using MB Views (shortcode method) to display these elements. No other pagebuilders or Gutenberg blocks are involved.

    If you need it, I can provide such access for you to verify the scenario.

    Kind regards,

    #38602
    UnakritiUnakriti
    Participant

    Here's the MB Views code:

    {{ mb.map( 'post.osm_id', '100%', '480px', '10' ) }}

    Kind regards,

    #38608
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I do not see that issue on my demo site, here is a screen record https://monosnap.com/file/PBiqcNxALbX1XKrZktWg5bZ5tSqoHD

    Can you please share the code that creates the custom fields and View code that outputs the field value on your site?

    #38613
    UnakritiUnakriti
    Participant

    Thanks for the Video, Long. In my scenario, the image and map custom fields are shown in separate views. Here's the requested code:

    Custom Field - Single Image

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'   => __( 'Post PIN', 'your-text-domain' ),
            'id'      => 'post-pin',
            'context' => 'side',
            'fields'  => [
                [
                    'name' => __( 'Title Pin', 'your-text-domain' ),
                    'id'   => $prefix . 'single_image_5x4mtt49jj',
                    'type' => 'single_image',
                ],
            ],
        ];
    
        return $meta_boxes;
    }

    Custom Field - Text and Map

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'   => __( 'Location and Map', 'your-text-domain' ),
            'id'      => 'location-and-map',
            'context' => 'side',
            'fields'  => [
                [
                    'name' => __( 'Enter Country, Region, or City', 'your-text-domain' ),
                    'id'   => $prefix . 'text_8sy68td8rn7',
                    'type' => 'text',
                ],
                [
                    'name'          => __( 'Zoom Level', 'your-text-domain' ),
                    'id'            => $prefix . 'osm_v4fb8cliwlo',
                    'type'          => 'osm',
                    'address_field' => 'text_8sy68td8rn7',
                    'language'      => 'en',
                    'region'        => 'in',
                ],
            ],
        ];
    
        return $meta_boxes;
    }

    View - Image
    <img src="{{ post.single_image_5x4mtt49jj.full.url }}" width="{{ post.single_image_5x4mtt49jj.full.width }}" height="{{ post.single_image_5x4mtt49jj.full.height }}" alt="{{ post.single_image_5x4mtt49jj.full.alt }}">

    View - Map
    {{ mb.map( 'post.osm_v4fb8cliwlo', '100%', '480px', '14' ) }}

    Thank you and look forward to your advise to resolve this.

    Kind regards,

    #38615
    UnakritiUnakriti
    Participant

    PS: Here's a screenshot to illustrate the problem further.

    https://imgur.com/a/YsKvupe

    Kind regards,

    #38622
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please share your site credentials via this contact form https://metabox.io/contact/
    I will take a closer look.

    #38625
    UnakritiUnakriti
    Participant

    Thanks for your support, Long. I have shared the details, as requested.

    Kind regards,

    #38627
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thanks for sharing the info. I'm able to reproduce the issue on my demo site and I've escalated this issue to the development team to fix it in the next update. Meanwhile, you can add the shortcode to display the image first and the shortcode to display the map after. Screenshot https://monosnap.com/file/8JJpmHDaqk7viAFyIurbJKPqtVLDp8

    #38628
    UnakritiUnakriti
    Participant

    Thank you for the confirmation, Long. Appreciate your support.

    I cannot change the order of the elements (image first and map second) because it won't fit into the article's flow.

    Any ETA on the fix?

    Kind regards,

    #39067
    UnakritiUnakriti
    Participant

    Hi,

    Is this resolved now?

    Kind regards,

    #39096
    PeterPeter
    Moderator

    Not yet, the development team is working on this issue. I will let you know when it is fixed.

    #39581
    UnakritiUnakriti
    Participant

    Thanks and eagerly looking forward to an update on this one!

    #39626
    PeterPeter
    Moderator

    Hello,

    Can you please update MB Views 1.11.4 or Meta Box AIO 1.16.7 to the latest version to fix this issue?
    Let me know how it goes.

    #39632
    UnakritiUnakriti
    Participant

    Yes, MB Views 1.11.4 does the trick. It's fixed.

    Thanks MB and Peter.

    Kind regards,

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