Skip Navigation

[Closed] View shortcode displaying in front end on migrated site

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.

This topic contains 6 replies, has 2 voices.

Last updated by Christian Cox 4 years, 6 months ago.

Assigned support staff: Christian Cox.

Author
Posts
#498845
Screen Shot 2017-03-09 at 10.26.21 AM.png
announcement-view-output-screenshot.png

I am trying to: Migrate my site from local machine to server

I visited this URL: Home page (access to this URL is restricted)

I expected to see: All views working normally, including "Announcements" view

Instead, I got: Views shortcodes (within Loop Output Editor) displaying on the front-end of the migrated site

I've attached the Loop Output Editor code as screenshot, which works as expected in the local machine, but shows the view shortcodes in the migrated site (as shown in screenshot).

I've tried various methods of migration, using All-in-one migration, FTP/DB export, and views export/import but they all result in the announcement view showing the shortcodes on the migrated site. All other views in migrated site seem to be working fine so far.

#498903

I have the following code in the Filter and Loop Output Integration Editor of the view:

[wpv-filter-meta-html]
[wpv-conditional if="( '[wpv-items-count]' ne '0' )"]
<div id="news-section">
<div class="home-section news news-announcements">
<p class="sub-title">Announcements</p>
[wpv-layout-meta-html]
</div>
</div>
[/wpv-conditional]

If I remove the conditional statement above and save the view, the shortcodes disappear in output. But i need this conditional to not show the view if output doesn't return any results.

Please help.

#498951

Hi, it's unusual that it's behaving differently in different environments unless the PHP versions are different. Are you using the same data source in both environments? I'm curious to know if something in one of the loop items is causing a disruption in the typical loop output, maybe an unclosed tag or something.

As a test, could you move the conditional logic out of the Filter and Loop Integration Editor and into the Loop Output Editor? So you'll always output the [wpv-layout-meta-html] shortcode, but your conditional logic will be applied inside it.

#498990

The PHP versions are different, source is 5.5.16 and destination is 7.0.15. Would that matter since all other views are working fine?

Not sure what you mean by Data source? They're both stored in MySQL DBs.

I tried moving the conditional out of the Filter and Loop Integration Editor and into the Loop Output Editor, but its still outputting the shortcodes in the front end.

#499009

I tried moving the conditional out of the Filter and Loop Integration Editor and into the Loop Output Editor, but its still outputting the shortcodes in the front end.

Okay thanks for testing that. I didn't realize you have shortcodes showing BEFORE the loop as well as after the loop, which I just noticed in your screenshot. I was thinking that the content of one of the loop iterations was causing a problem rendering the rest of the loop. But this doesn't make sense now that I see shortcodes rendered BEFORE the loop items are shown.

The PHP versions are different, source is 5.5.16 and destination is 7.0.15. Would that matter since all other views are working fine?
It's possible this is the only View affected, but not likely.

Not sure what you mean by Data source? They're both stored in MySQL DBs.
Are the databases identical. I was thinking that it's possible one of the loop elements had some bad data or invalid HTML markup, which was breaking the loop output. If the databases don't match, that could indicate bad data in one database. But since I see you have shortcodes output before the loop items start, this seems to indicate that something else is going on.

Are any errors shown in your browser console when you visit the page where shortcodes are displayed?

I would like to see if your WordPress installation is registering any errors. You can see how to enable debug logging here:
https://toolset.com/documentation/user-guides/debugging-toolset/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Edit your wp-config.php file and add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . 'https://cdn.toolset.com/error_log.txt');

Navigate to a page where you can find the shortcodes output. If any errors are generated, the error_log file will be created. Please send me its contents. Once that is done, you can revert the updates you made to wp-config.php.

#499018

Thanks for helping troubleshooting Christian. My response below:

Are any errors shown in your browser console when you visit the page where shortcodes are displayed?
No errors in the console

I would like to see if your WordPress installation is registering any errors.
I added the code in wp-config.php, saved it and opened a page with the shortcode displaying in the front-end. It didn't create a error_log.txt file so I created one with 777 permissions in the website root. Refreshed the page but the file is still empty.

#499021

Okay thanks for the update. I think the next step will be for me to take a look in your wp-admin area. The best way to do that is to give me login credentials and open the URL so I can access it somehow. If that's not possible, you can use Duplicator (I see you already have it installed) to create a clone for me. I will need the login credentials for a user that exists before the clone is made. Then you can upload the installer and archive zip to Dropbox or Google Drive or another file sharing service I can access. I will install the clone locally and test it out.

If possible, create a clone without filtering files or truncating the database. The closer the clone is to your actual site, the better chance I will have to find the problem quickly.

I will enable a protected reply here so you can share the credentials and download URLs privately.

The topic ‘[Closed] View shortcode displaying in front end on migrated site’ is closed to new replies.