PHP notice regarding Leaflet CSS files in Metabox (latest version of AIO)

Support Meta Box AIO PHP notice regarding Leaflet CSS files in Metabox (latest version of AIO)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #50053
    ShemzoneShemzone
    Participant

    Hello everyone,

    Since WordPress 7.0 (I assume, as I hadn’t paid much attention to the log up until then), I’ve been getting PHP warnings regarding the Leaflet CSS in Metabox.

    PHP Notice: The wp_maybe_inline_styles function was called <strong>incorrectly</strong>. Unable to read the ‘path’ key with value ‘https://mywebsite.local/wp-content/plugins/meta-box/js/leaflet/leaflet.css’ for the ‘leaflet’ stylesheet. Please read <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> (en) for more information. (This message was added in version 7.0.0.) in /home/myhome/mywebsite.local/wp-includes/functions.php on line 6170
    and
    PHP Notice: The wp_maybe_inline_styles function was called <strong>incorrectly</strong>. Unable to read the ‘path’ key with value ‘https://mywebsite.local/wp-content/plugins/meta-box/js/leaflet/leaflet-gesture-handling.min.css’ for the ‘leaflet-gesture-handling’ stylesheet. Please read <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> (en) for more information. (This message was added in version 7.0.0.) in /home/myhome/mywebsite.local/wp-includes/functions.php on line 6170

    I suppose it’s not a big deal, but it’s still annoying and I’d like to avoid it.
    Do you have any ideas or information?

    My server uses PHP 8.3.31, WordPress 7.0, MetaBox 5.12 and MetaBox AIO 3.7.1

    Thanks

    #50055
    PeterPeter
    Moderator

    Hello Shemzone,

    Thanks for your feedback.

    The issue could happen when using WP 7.0, which adds more checks to the path to register the script files. The code that causes the issue

    
    wp_style_add_data( 'leaflet', 'path', RWMB_JS_URL . 'leaflet/leaflet.css' );
    wp_style_add_data( 'leaflet-gesture-handling', 'path', RWMB_JS_URL . 'leaflet/leaflet-gesture-handling.min.css' );
    

    in the file wp-content/plugins/meta-box/inc/fields/osm.php. We should pass the correct PATH to the function wp_style_add_data instead of using a URL.

    I've escalated the issue to the development team to fix it in the next update of Meta Box plugin.

    #50058
    ShemzoneShemzone
    Participant

    Thank you @Peter

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