Fatal error in traceErrorMsg() on PHP 7.1.
-
Hi folks, one of my users encountered an error on a site that uses WPML (for multi-lingual pages) and OSM plugin. While creating a new translation of a page at /wp-admin/post.php?post=2&action=edit&lang=en they encountered a fatal PHP error:
Fatal error: Uncaught Error: Using $this when not in object context in .../wordpress/wp-content/plugins/osm/osm.php on line 249
which was triggered by this OSM error:[OSM-Plugin-Error]:Array hast got wrong file extension (gpx, kml)!
. While there may be other conflicts with these two plugins, fixing the fatal PHP error in the OSM plugin allows the editor to load successfully on PHP 7.1.29 even though the OSM error flashes a bit.Here is a patch to fix the fatal error in the OSM plugin:
diff --git a/wp-content/plugins/osm/osm.php b/wp-content/plugins/osm/osm.php index 60a0dd6..11b71c4 100644 --- a/wp-content/plugins/osm/osm.php +++ b/wp-content/plugins/osm/osm.php @@ -246,7 +246,7 @@ class Osm public static function traceErrorMsg($e = '') { - if ($this == null){ + if (!isset($this) || $this == null){ return $e; } $EMsg = $this->ErrorMsg->get_error_message($e);
- The topic ‘Fatal error in traceErrorMsg() on PHP 7.1.’ is closed to new replies.