Skip Navigation

[Resolved] No display on refresh of shortcode used in a view

This support ticket is created 2 years, 6 months 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 8 replies, has 2 voices.

Last updated by alanS3341 2 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2360035
2022-05-10_17-46-43.jpg

I am trying to:
Use a shortcode in a ciew. It works when I load the page, but disappears after I refresh the page

Link to a page where the issue can be seen:
hidden link

I expected to see:
The map displaying on page refresh.

Instead, I got:
It works the first time it is viewed by not after that. I am using this: [types field='activity_map'][/types]

The plugin is: https://wordpress.org/plugins/os-datahub-maps/

I have checked Chrome Dev Tools and getting this message:

DevTools failed to load source map: Could not load content for hidden link: Fetch through target failed: Session is unregistering, can't dispatch pending call to Network.loadNetworkResource; Fallback: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for hidden link: Fetch through target failed: Session is unregistering, can't dispatch pending call to Network.loadNetworkResource; Fallback: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for hidden link: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for hidden link: Connection error: net::ERR_CONNECTION_REFUSED

The map is based on a field that has a shortcode inserted into it

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="name-border">
<h5 class="card-title">[types field="activity_name"][/types]</h5><br>
</div>
[wpv-conditional if="( $(wpcf-360-view) ne '' )"]
<iframe src="[types field='360-view' output='raw'][/types]" width='100%' height='480px'></iframe>
[/wpv-conditional]

[wpv-conditional if="( $(activity_image) ne '' )"]
[types field='activity_image' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]
[/wpv-conditional]

<div class="card mb-3">

<div class="card-body">
<p class="card-text">
[types field="activity_description"][/types]
</p>
[types field='activity_map'][/types]

<p class="card-text">
<small class="text-muted">Activity Type: [types field="activity_type"][/types]</small><br>
<small class="text-muted">Distance: [types field="activity_distance"][/types] KM</small><br>
<small class="text-muted">Dificulty: [types field="activity_difficulty"][/types]</small>
</p>

</div>
</div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#2360563

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I can see you are outputting the third party shortcode added to custom field and that shortcode seems to display the map.

The problem URL you shared, I do not see any map on first load or even after reloading the page:
- hidden link

Can you please share more details where I can see the map?

#2360591
2022-05-11_10-27-51.jpg

Thanks for the reply, I have included an image and can provide login details if you need them

#2360661

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes I can see the same error message on chrome browser console:

DevTools failed to load source map: Could not load content for <em><u>hidden link</u></em>: Fetch through target failed: Session is unregistering, can't dispatch pending call to Network.loadNetworkResource; Fallback: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for <em><u>hidden link</u></em>: Fetch through target failed: Session is

I see the URL refers to localhost, did the site hosted on localhost before and then you migrated it?

Even I do not see the map is loaded on first load, you need to check with the "os-datahub-maps" plugin author what is missing in this case as Toolset's role is to display the value that you added to field. Do it require any dependencies all those answers should be known to plugin author. Would you mind to check with plugin author and if there is issue with Toolset and Toolset is involved we are happy to help based on direction given by your plugin author.

#2362061

I disabled a 360 view iframe and now see no errors in the console. However, Toolset is still not displaying the shortcode of the map. There is a version here: hidden link
Which is not contained within a view as a shortcode and can easily be seen and refreshed. It seems only to be a problem when contained as a shortcode in a view here as already described and shown in the previous image:
hidden link

#2362069

I also received this reply from os-datahub-maps:

The reason the map doesn’t appear on that page is that the Javascript files which the plugin adds to the WordPress output queue are not actually being sent. My best guess is that some other plugin is interfering with the way WordPress works. WP Views maybe?
The plugin appears to be working fine on your demo page without those other items.

#2362269

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

If you add a third-party shortcode to Toolset custom field, Toolset's role is to just display the value.

I'll need admin access details in order to check further and see if anything we can do here.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2362401

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now: hidden link

I can see the map when I refresh the page, do you see it working? If yes, its resolved.

I just disabled the view's cache as you can see with the following screenshot:
=> hidden link

#2362429

Great Support