Support » Plugin: Basic Google Maps Placemarks » PHP7 error with BGMP and WooCommerce

  • Ran into an issue when we upgraded a site running BGMP to PHP7.2. Eventually tracked it down to a conflict between BGMP and WooCommerce, specifically around the the_title filter.

    It was effectively the same issue as described under the example here: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title – WooCommerce doesn’t define a default value for the second parameter to the filter and BGMP doesn’t provide a value. In PHP5 this only triggered a warning, but in PHP7 it’s a fatal error.

    If anyone else runs into the same problem, the solution was to add an additional parameter to the apply_filter('the_title') calls in core.php (line 1416) and views/shortcode-bgmp-list-marker.php (line 3).

    I.e.

    'title' => apply_filters( 'the_title', $pp->post_title, null ),

    and

    echo apply_filters( 'the_title', $p->post_title, null );

    respectively.

    Would be great if this could be fixed in the next version of the plugin, if it’s still being maintained?

  • The topic ‘PHP7 error with BGMP and WooCommerce’ is closed to new replies.