Skip Navigation

[Closed] View gives blank page when not logged in; works fine when logged in

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 9 replies, has 3 voices.

Last updated by Luo Yang 7 years, 1 month ago.

Assigned support staff: Luo Yang.

Author
Posts
#122202

I have a view that works fine when the user is logged in but presents a blank page when the user is not logged in.

The only thing on the page is the view shortcode:
[wpv-view name="UnitSearchView2"]

The page is public and published.

When not logged in, the page source returned in the browser is this:

</body>
</html>

Any suggestions how I can enable guests who are not logged in to see the view properly?

Thanks.

Brad

#122379

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi Brad,

Could you enable WP debug mode and post the debug logs here?
https://toolset.com/documentation/user-guides/debugging-types-and-views/

#122482

Hi Luoy,

Thanks for the helpful pointer to the debug information.

I was able to isolate the problem but not solve it completely. I found the following error log entries when I attempted to view the problematic blank page on my site.

[07-Aug-2013 12:32:38 UTC] PHP Notice: Undefined index: title in /home/wilmdex3/public_html/wp-content/plugins/wp-external-links/includes/class-wp-external-links.php on line 257
[07-Aug-2013 12:32:38 UTC] PHP Notice: Undefined index: title in /home/wilmdex3/public_html/wp-content/plugins/wp-external-links/includes/class-wp-external-links.php on line 257
[07-Aug-2013 12:32:38 UTC] PHP Notice: Undefined index: title in /home/wilmdex3/public_html/wp-content/plugins/wp-external-links/includes/class-wp-external-links.php on line 257

It's only a NOTICE not an ERROR but something in the wp-external-links plugin is definitely conflicting with Toolset.

The problem only manifests when the user is not logged in. No problem, no notice when the user is logged in.

Here is the code from lines 255 - 257:

// set title
$title = $this->get_opt( 'title' );
$attrs[ 'title' ] = str_replace( '%title%', $attrs[ 'title' ], $title );

I tried the following change to line 257 to work around the problem:

if(isset($attrs[ 'title' ])){$attrs[ 'title' ] = str_replace( '%title%', $attrs[ 'title' ], $title ); }

The result of that change was no more notice in the error log when a not-logged-in user goes to the problematic page, but the page is still blank. Likewise, a logged in user still has no problem, no notice, and the page displays properly.

If I completely deactivate the WP External Links plugin, the not-logged-in user can display the page properly, just as a logged in user can.

So it seems there is some conflict between WP External Links and Toolset, but it wasn't just the NOTICE about line 257.

Can you suggest how to resolve the conflict?

Thanks.

Brad

#122500

Make sure you dont have filter in view to restrict view for logged in users

#122515

Thanks for thinking of that, but I checked and don't have any view filter to restrict the view to logged in users.

#122729

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Are we talking about the plugin "WP External Links" from:
http://wordpress.org/plugins/wp-external-links/

Could you describe detail steps to duplicate same problem?
I need debug it in my localhost, thanks

#122790

Hi Luoy,

Yes, that's the plugin. I consistently observe the problem (blank page for not-logged-in user) when I activate the plugin and then attempt to view my page that has the following structure:

View1
Content Template1
View2
Content Template2

The problem page contains only a view shortcode, but this view (View1) produces a nested structure of views and templates: View1 displays Content Template1, which displays View2, which displayes Content Template2.

I can email you access to a test site if you like, or I can export and provide any files you need.

Thanks for your help.

Brad

#123782

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can not duplicate same problem in my localhost, Could you duplicate the problem in a fresh wordpress installation,
and send the login details to my email and ftp access to my email: luo.y@onthegosystems.com

#127712

Hi Luoy,

Sorry for the delay. Let me know if you don't receive the login details.

Brad

#129528

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Sorry, I didn't got the email from your email b***@tutorsystems.com
Could you send it again?

The topic ‘[Closed] View gives blank page when not logged in; works fine when logged in’ is closed to new replies.