Issue call reset() on boolean #4

Closed
opened 2019-11-19 22:11:49 +00:00 by allanext · 6 comments

Hi,

It looks like the plugin can have a great potentiality for the pods community!

I have a Custom Post Type and i've tried to follow your instructions but i'm getting the following error when loading the table from the shortcode:

Uncaught Error: Call to a member function reset() on boolean in /var/www/html/wordpress/wp-content/plugins/tablepress-pods/tablepress-pods.php:107
Stack trace:
#0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(288): playground_expand_pod(Array, Array)
#1 /var/www/html/wordpress/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
#2 /var/www/html/wordpress/wp-content/plugins/tablepress/classes/class-render.php(119): apply_filters('tablepress_tabl...', Array, Array)
#3 /var/www/html/wordpress/wp-content/plugins/tablepress/controllers/controller-frontend.php(644): TablePress_Render->set_input(Array, Array)
#4 /var/www/html/wordpress/wp-includes/shortcodes.php(325): TablePress_Frontend_Controller->shortcode_table(Array, '', 'table')
#5 [internal function]: do_shortcode_tag(Array)
#6 /var/www/html/wordpress/wp-includes/shortcodes.php(199): preg_replace_cal

Hi, It looks like the plugin can have a great potentiality for the pods community! I have a Custom Post Type and i've tried to follow your instructions but i'm getting the following error when loading the table from the shortcode: Uncaught Error: Call to a member function reset() on boolean in /var/www/html/wordpress/wp-content/plugins/tablepress-pods/tablepress-pods.php:107 Stack trace: #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(288): playground_expand_pod(Array, Array) #1 /var/www/html/wordpress/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array) #2 /var/www/html/wordpress/wp-content/plugins/tablepress/classes/class-render.php(119): apply_filters('tablepress_tabl...', Array, Array) #3 /var/www/html/wordpress/wp-content/plugins/tablepress/controllers/controller-frontend.php(644): TablePress_Render->set_input(Array, Array) #4 /var/www/html/wordpress/wp-includes/shortcodes.php(325): TablePress_Frontend_Controller->shortcode_table(Array, '', 'table') #5 [internal function]: do_shortcode_tag(Array) #6 /var/www/html/wordpress/wp-includes/shortcodes.php(199): preg_replace_cal
Owner

Thanks for your interest in Tablepress-Pods and for the feedback. I will look into the issue this evening. Please could you post the shortcode invocation that is leading to this error? It would also be helpful if you're able to post the contents of the table that it is being fetched, maybe as a screenshot if need be. If it's big, just a portion of the table starting from the first row would suffice. Thanks very much! Glen

Thanks for your interest in Tablepress-Pods and for the feedback. I will look into the issue this evening. Please could you post the shortcode invocation that is leading to this error? It would also be helpful if you're able to post the contents of the table that it is being fetched, maybe as a screenshot if need be. If it's big, just a portion of the table starting from the first row would suffice. Thanks very much! Glen
Author

find attached:

  • the pod type Journal2 with all its fields
  • the shortcode
  • the definition of the table with the pods fields

Thank you !!!

find attached: - the pod type Journal2 with all its fields - the shortcode - the definition of the table with the pods fields Thank you !!!
Owner

Investigating now. Just to be certain, there are for sure some items of type journal2? You've created at least one entry in this pod?

Investigating now. Just to be certain, there are for sure some items of type journal2? You've created at least one entry in this pod?
Owner

Thanks for confirming there are many entries. What's happening is that the pods() call to get the data from the pod is returning FALSE. But I can't reproduce this behavior on my test site. So I guess I need to ask more questions:

  1. According to Pods documentation, the pods() call can only return false if you have PODS_STRICT set. Is that the case in your installation?
  2. If you replace your shortcode with
    [pods name="journal2"]Hello {@recnum}[/pods]
    does it correctly produce a list of the first several record numbers of your pod?
    Sorry not to have tracked this down yet.
Thanks for confirming there are many entries. What's happening is that the pods() call to get the data from the pod is returning FALSE. But I can't reproduce this behavior on my test site. So I guess I need to ask more questions: 1) According to Pods documentation, the pods() call can only return false if you have PODS_STRICT set. Is that the case in your installation? 2) If you replace your shortcode with [pods name="journal2"]Hello {@recnum}[/pods] does it correctly produce a list of the first several record numbers of your pod? Sorry not to have tracked this down yet.
Owner

Another hypothesis occurred to me: perhaps with 13000 entries and so many fields, the attempt to slurp the entire pod at once is running afoul of some resource limitations. Are you comfortable editing one of the source files in place? If so, please change line 71 of the tablepress-pods.php file inside the plugin to read

$pod_params = array('limit'=>50);

instead of

$pod_params = array('limit'=>-1);

and see if you now get a table of your first 50 records, instead of the error. (Note this is just a temporary test, I will ultimately fix the module to make sure you get all of your records.)

If you're not really up for editing code in place, let me know, and I will prepare a special test version of the module with this change for you to install and try.

Another hypothesis occurred to me: perhaps with 13000 entries and so many fields, the attempt to slurp the entire pod at once is running afoul of some resource limitations. Are you comfortable editing one of the source files in place? If so, please change line 71 of the tablepress-pods.php file inside the plugin to read `$pod_params = array('limit'=>50);` instead of `$pod_params = array('limit'=>-1);` and see if you now get a table of your first 50 records, instead of the error. (Note this is just a temporary test, I will ultimately fix the module to make sure you get all of your records.) If you're not really up for editing code in place, let me know, and I will prepare a special test version of the module with this change for you to install and try.
glen added the
notReproduced
label 2021-02-09 01:50:24 +00:00
Owner

Since there's been no feedback for a year and I was unable to reproduce, closing.

Since there's been no feedback for a year and I was unable to reproduce, closing.
glen closed this issue 2021-08-20 22:19:10 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: glen/tablepress-pods#4
No description provided.