Skip Navigation

[Gelöst] wp-views causing PHP Fatal error call to a member function on a non object

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 Antworten, has 3 Stimmen.

Last updated by markW-13 vor 5 Jahre, 1 Monat.

Assigned support staff: Minesh.

Author
Artikel
#467933

I am hosted with WP Engine and they're highlighting a PHP error apparently caused by wp-views

PHP Fatal error: Call to a member function get_template_id() on a non-object in /nas/content/live/blueprintmw1/wp-content/plugins/wp-views/embedded/inc/wpv-shortcodes.php on line 2598

The shortcodes file has not been modified in any way in my child theme and I am using Toolset Starter, so please help me to understand how to correct this error. Example page:

hidden link

I can send you any login details or files that you require.

Regards,
Andy

#468103

Minesh
Supporter

Languages: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

I checked the URL you shared with me but the page is loaded without displaying any error:
=> hidden link

Have you disabled the views plugin?

1)
Could you please share exact steps to reproduce this error or clean install?

2)
Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?

3)
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

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

#468266

Minesh
Supporter

Languages: Englisch (English )

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

Thanks for sharing information. Yes - I would like to have steps to reproduce this issue and where they seen it. I'll wait for your answer and as soon as we will have enough information I will start to debug this issue further.

#468341

while profiling the site using wp-cli:

mcalabresi_@pod-34509:$ php wp-cli.phar profile stage --path=/nas/content/live/blueprintmw1
PHP Fatal error: Call to a member function get_template_id() on a non-object in /nas/content/live/blueprintmw1/wp-content/plugins/wp-views/embedded/inc/wpv-shortcodes.php on line 2598
Fatal error: Call to a member function get_template_id() on a non-object in /nas/content/live/blueprintmw1/wp-content/plugins/wp-views/embedded/inc/wpv-shortcodes.php on line 2598
<!DOCTYPE html>
<!--[if lt IE 7 ]>
<html lang="en-GB" prefix="og: hidden link" class="no-js ie ie6 ie-lte7 ie-lte8 ie-lte9"><![endif]-->
<!--[if IE 7 ]>
<html lang="en-GB" prefix="og: hidden link" class="no-js ie ie7 ie-lte7 ie-lte8 ie-lte9"><![endif]-->
<!--[if IE 8 ]>
<html lang="en-GB" prefix="og: hidden link" class="no-js ie ie8 ie-lte8 ie-lte9"><![endif]-->
<!--[if IE 9 ]>
<html lang="en-GB" prefix="og: hidden link" class="no-js ie ie9 ie-lte9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en-GB" prefix="og: hidden link" class="no-js"><!--<![endif]-->

This error only causes part of the page to render:
[ truncated for space/formatting ]

<div class="serspace">
<div class="serspace10"><input type="text" name="wpv_post_search" class="js-wpv-filter-trigger-delayed" /></div>
<div class="serspace10 subh22"><input type="submit" value="Search Now" name="wpv_filter_submit" /></div>
<div style="display:none" class="js-wpv-dps-spinner centre"><img src="hidden link" /></div>
</div>

</form> </div>

</div>
</header>
<section class="container container-main" role="main">

[ rendering ends here ]
Skipping the plugin causes the profiling information to display, as the page now renders:

mcalabresi_@pod-34509:~$ php wp-cli.phar profile stage --path=/nas/content/live/blueprintmw1 --skip-plugins=wp-views
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
| stage | time | query_time | query_count | cache_ratio | cache_hits | cache_misses | hook_time | hook_count | request_time | request_count |
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
| bootstrap | 1.1476s | 0.0168s | 33 | 79.59% | 499 | 128 | 0.6064s | 4216 | 0s | 0 |
| main_query | 0.0148s | 0.001s | 2 | 97.22% | 35 | 1 | 0.0071s | 78 | 0s | 0 |
| template | 1.6347s | 0.0637s | 136 | 98.97% | 6729 | 70 | 0.8213s | 11633 | 0s | 0 |
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
| total (3) | 2.797s | 0.0815s | 171 | 91.93% | 7263 | 199 | 1.4348s | 15927 | 0s | 0 |
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+

(most of which means nothing to me, it is all copied from Wp Engine's message to me)

#469012

Minesh
Supporter

Languages: Englisch (English )

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

Please allow me to consult our developers and I'll get in touch with you as soon as possible.

#469016

OK - thank you, I can also put you in touch directly with my hosting consultant if required.

#469196

Minesh
Supporter

Languages: Englisch (English )

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

Our developers confirm the issue and they will provide fix as soon as possible. Please hold on for further updates.

I'll get int touch with you as soon as I know more.

#469278

OK thanks look forward to hearing from you.

#469635

Hi,

This is Mohammed: The Toolset support team leader.

I'm posting here to inform you that the issue can be fixed by uploading this file: hidden link to the root directory in Views plugin replacing the file with the same name.

Can you please test if this fixes the issue and let us get your feedback?

Thanks.

#470181

The error no longer occurs.

Thank you so much for such a simple way to fix this. Please confirm whether the file you sent (wp-views.php) should be saved and then re-uploaded after each future update of the Toolset software?

Kind regards,
Andy