Skip Navigation

[Resolved] Error "Your location is needed to show this content" on a view…

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

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.

Our next available supporter will start replying to tickets in about 1.85 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 9 replies, has 2 voices.

Last updated by joseL-6 5 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1363715

On the home page indicated, the view displaying next to the Map (which is also a view) is supposed to show a list of locations. However it only displays the error "Your location is needed to show this content. "

The 2 views are identical to the ones showing on hidden link and on THAT page the list shows fine. It displays the locations in the order of which is closest to you.

Any idea what's happening? I'm allowing location access in the browser, and like I said the views are built the same way. I actually EXPORTED the post types and views FROM the non-working site to the working one.

#1363819
Screen Shot 2019-10-17 at 3.18.46 PM.png

You or someone else using your browser must have allowed access to your location on those other sites at some time, and dismissed or declined access on the current site. I'm attaching a screenshot showing what I see when I load the hidden link website - I see the same error and I'm prompted to allow access to my location. If I choose yes, I'll see the results. If I choose no or dismiss the dialog, I'll see the error message.

If you no longer see the location access prompt when you load the page for the mentioned site, you should check your browser settings and reset the location usage criteria for that site. Then the browser should prompt you again for access, and then you should see the results.

#1363843

Yes correct... I did that already on hidden link but on THAT site the error still shows, even after location access is turned on?

Are you saying that when you go to hidden link you can allow location access and see the list?

#1363849

I just tried it with 2 other browsers for a total of 3: Chrome, Firefox and Safari, and selected to allow location access for all... for THIS site, I still get the error message.

I checked the inspector and see an error in the Console:

Uncaught TypeError: $ is not a function
at HTMLDocument.<anonymous> ((index):920)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)

Which seems related to this script:

<script type='text/javascript'>
$( document ).ready( function() {
$( window ).load( function() {
WPViews.location.initWithReload();
} );
} );
</script>

Which seems to load after the toolset-maps scripts

<script type='text/javascript' src='//dentalassociatesct.com/wp-content/plugins/toolset-maps/resources/js/markerclusterer.js?ver=1.0'></script>
<script type='text/javascript' src='//dentalassociatesct.com/wp-content/plugins/toolset-maps/resources/js/oms.min.js?ver=1.0'></script>
<script type='text/javascript' src='//dentalassociatesct.com/wp-content/plugins/toolset-maps/resources/js/js.cookie-2.2.0.min.js?ver=2.2.0'></script>
<script type='text/javascript' src='//dentalassociatesct.com/wp-content/plugins/toolset-maps/resources/js/toolset_maps_location.js?ver=1.8.4'></script>
<script type='text/javascript'>
$( document ).ready( function() {
$( window ).load( function() {
WPViews.location.initWithReload();
} );
} );
</script>
<script type='text/javascript' src='hidden link;
<script type='text/javascript' src='hidden link;
<script type='text/javascript' src='hidden link;
<script type='text/javascript' src='hidden link;

#1363851

Oh sorry I misunderstood. Yes, I do still see the error after allowing location access. I also see a JavaScript error in the console:

(index):902 Uncaught TypeError: $ is not a function

Sometimes this indicates a conflict with another plugin or some code in your theme. Is it possible for you to try these troubleshooting steps?
- Temporarily deactivate all plugins except Types, Views and Maps. Activate a default theme like Twenty Nineteen
- Place the map on some custom page if it is not visible on the homepage, and test again. If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns. If the problem is not resolved, I'll need to take a closer look in wp-admin.

#1363865

AH. It seems to be something in the header... when I add this to a blank page with a "no header/footer" page template the list appears...

I am using the Beaver Builder theme and plugin, BUT I am also using the same combo on the other site that already worked, which is weird.

#1363947

I'm really not sure what happened... It's working now. What I did was turn off Beaver Builder's option to show a fixed header at the top when a user scrolls the page. Whe I did that the list appeared.

HOWEVER, when I turned it BACK ON, the list is still there working fine... was this a cache thing?

#1365101

I am using the Beaver Builder theme and plugin, BUT I am also using the same combo on the other site that already worked, which is weird.
It could be related to a configuration in the theme settings, as opposed to the theme or plugin per se. Like if you have the ability to load a Google Maps API, that could potentially conflict with Toolset Maps. If there is a spot for adding custom code in the theme options, there could be an issue in part of that code.

HOWEVER, when I turned it BACK ON, the list is still there working fine... was this a cache thing?
It's possible, but hard to say for sure. I would be glad to look in your wp-admin area and check your theme options and other configurations to see if anything looks suspicious. If you'd like me to check, feel free to add your login credentials here in the private reply fields and I'll take a look. If everything seems okay, it might not be necessary. Let me know, thanks!

#1365707
Screen Shot 2019-10-21 at 2.32.12 PM.png
Screen Shot 2019-10-21 at 2.32.17 PM.png

I'm not seeing the problem right now, I've tried two different browsers, logged in and logged out, and I see results in all cases after I allow location access in the browser. Is there a particular device or browser you are using to test?

#1365789

Christian, yes I think I solved it using your suggestion about plugin conflicts.
A little background: this site is a rebuild of an existing site with a different domain so in a sense it's a staging site. We migrated the old site over (including the original theme and all plugins) and then started rebuilding.

Trying to troubleshoot this I switched to different themes and that didn't work so I figured it was a plugin. I turned off ALL plugins and turned them on one by one until all the plugins I actually need for this version of the site were on... and everything still worked. SO it must be one of the other unnecessary plugins.

BTW the OTHER site which DID work was built from scratch.