Home › Toolset Professional Support › [Resolved] View with Maps gives error message: Warning: array_key_exists()
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - | - | 9:00 – 13:00 |
14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - | - | 14:00 – 18:00 |
Supporter timezone: Africa/Casablanca (GMT+01:00)
Tagged: Toolset Blocks, Toolset Maps
Related documentation:
This topic contains 2 replies, has 2 voices.
Last updated by kai-peterW 3 years, 8 months ago.
Assisted by: Jamal.
I build a page with view and a map (view block) using the block editor. On the backend the map is displayed correctly with the markers.
All of the address fields have valid values.
On the front end these errors show up:
Warning: array_key_exists(): The first argument should be either a string or an integer in ..../wp-content/plugins/toolset-maps/includes/toolset-common-functions.php on line 1116
Warning: strpos() expects parameter 1 to be string, array given in .../wp-content/plugins/toolset-maps/includes/toolset-common-functions.php on line 1124
Warning: urlencode() expects parameter 1 to be string, array given in ...../wp-content/plugins/toolset-maps/includes/toolset-common-functions.php on line 1464
The code around line 1116 is the following:
private static function get_coordinates_new( $address, $skip_cache=false ) {
// Get coordinates from cache, if available
if ( ! $skip_cache ) {
$coordinates_set = self::get_cached_coordinates();
Line 1116: if ( array_key_exists( $address, $coordinates_set ) ) {
return $coordinates_set[ $address ];
}
}
My toolset plugins Blocks, Types and Maps are up to date.
What could be the problem?
Hello and thank you for contacting the Toolset support.
Let's first be sure that this is not caused by an incompatibility with another component of the website, please check if this issue appears when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.
If this does not help find the cause of the issue, make sure that you are using an Address field instead of a simple single-line field. And go to Toolset->Settings->Maps, load the cached addresses and remove them, then try again.
If this does not help, we might need to take a copy of your website and debug it locally. Let me know if that's fine with you.
Thank you for your support Jamal.
I deactivated all plugins and deleted the cached addresses but the problem persisted.
Then I deleted all markers and created a new one and updated the page.
And Eureka, worked without any errors. That was the solution.
Something with the markers went wrong.
If other uses might have the same problem: try to delete all markers first and then creat a new one and update the page!
My issue is resolved now. Thank you!