GoogleStoreLocator in MODX3 and PHP 8.1

Is anybody successfully using… GoogleStoreLocator 2.0.3-pl | MODX with PHP 8.1 or 7.4 in MODX3.

Rolled this back to 7.4 and it is working but with the following warning, which may give a clue…

[2024-03-25 15:44:02] (ERROR @ /httpdocs/folder/core/components/googlestorelocator/model/googlestorelocator/googlestorelocator.class.php : 381) PHP warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP)

There is this pull request on Github that seems to fix this issue:

Thank you Harry - been looking all day for an answer to this. What I can’t understand is how this didn’t show up in search results when I was looking.

Just to follow up a little on this; I swapped back down to PHP7.4 after making that fix above and everything worked (MODX3.0.4). When I tried PHP8.1 I was getting errors like…

core/components/googlestorelocator/model/googlestorelocator/googlestorelocator.class.php : 26) PHP warning: Undefined array key "tvname_country"

…but when I tried PHP8.2 I didn’t get those errors. Will keep an eye on things and test as much as possible but it seems to be working.

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.