Blank petition list
-
Somehow dk_speakout_Petition::all gets a $limit of +INF.
The limit value needs to be constrained.
Add this to the
all
method;$limit = (int) $limit; if ($limit <= 0 || $limit < $start || !is_finite($limit)) { $limit = PHP_INT_MAX; }
-
This topic was modified 5 years, 5 months ago by
youngcp.
-
This topic was modified 5 years, 5 months ago by
-
Thanks for that feedback @youngcp . Can you give me some details on any problems this is causing or errors thrown? In my testing site that has no petitions I can’t see any issues.
We created a petition and the table looked like this;
All Petitions (1) 1 items 1 of INF > >>
ID Petition name Shortcodes Signatures Goal
ID Petition name Shortcodes Signatures Goal
1 items 1 of INF > >>I added an echo inside the $petitions for loop, was not hit.
I added more echos and aprint_r
to find the array was empty and the SQL string generated ended with ‘LIMIT 1, ‘ (missing the actual limit variable).It still reads ‘1 of INF’ but now the petition is shown.
Thanks for that info. I think the problem may be that you are using an old or modified version of SpeakOut! plugin.
A few versions ago I removed the pagination links if there is only one page of petitions. The fact that they are there indicates it may be not up to date.
Which version? If you are using 1.17.5 can you post a link to the petition page?
This is a fresh install of the plugin v1.17.5 on a WordPress.com hosted site, running WP v5.2.3.
We can not post a link at this time, the contents are not public yet.
From downloading the plugin v1.17.5 zip file (https://downloads.wordpress.org/plugin/speakout.zip) and navigating to
speakout/includes/petitions.view.php:11
, the pagination is still present.Hmmm…this is very odd. Here is a screenshot of a clean install of 1.17.5 for me https://gyazo.com/8c43feb7c5de0d207427547c8a385716
Can you go to https://speakout.123host.net.au/contact and get in touch with me by email, I am curious about what is going on here.
Thanks
Ok, I sent you a message via the form.
OK. I think I have found the problem.
If you go to dashboard > SpeakOut! > settings > admin display tab – I think you may have 0 in that field.
That recreates the INF for me. If that is so, change the value to something reasonable, the default is 20. I am going to add some code to prevent a value of 0 being saved.
https://images2.imgbox.com/30/0a/YJHs1MZ1_o.png
I have nothing in that field, this is a new install.
Settings have not been configured. The default is blank.
Changing it does resolve the issue.
-
This reply was modified 5 years, 5 months ago by
youngcp.
OK, send me the login and let me have a look.
Thanks for working with me on this, I appreciate it.
I have just pushed version 1.17.6 – can you save the settings page and see if that solves this?
If you could, reply to the email address I submitted in the contact form and I’ll create the account and have WP send you the account details.
Will do.
When saving with the fields blank, they now default to 1.
I’d rather not try wiping the settings from the database to try a “clean” setup to see if the defaults work properly on this site though.
Thanks for updating the plugin.
-
This reply was modified 5 years, 5 months ago by
youngcp.
I’m in UTC-4, so it’s late, so I may reply tomorrow.
Tyler, I did respond to your email. Did you receive that?
Also, that is very deliberate having the settings default to 1 if you leave it blank (or if you save it as 0). Having the number of petition rows to display be blank doesn’t make sense – logically it needs to be some value.
If you want it “infinite” then set it high.
Hope that helps.
I set them to the “defaults” written beside them of 20 and 50 for petition and signature tables respectively.
Unfortunately I have not received any reply email.
With a bit of googling, I assume the email address for the creation of the account will be speakout###@###123host.com.au sans hashes?
-
This reply was modified 5 years, 5 months ago by
- The topic ‘Blank petition list’ is closed to new replies.