[ad_1]
I’m using version 3.2.4 (Free version).
A new petition is initialized with allow_anonymous turned off. But once the second tab of the petitions properties is edited and saved, allow_anonymous is turned on and cannot be turned off again.
The reason for this is that in addnew.view.php line 131:
<input type=”hidden” name=”allow_anonymous” value=0>
the html-parameter is always set (even if set to 0) before it is again used in the checkbox in line 132:
<input type=”checkbox” name=”allow_anonymous” id=”allow-anonymous” <?php if ( $petition->allow_anonymous == 1 ) echo ‘checked=”checked”‘; ?> />
In class.petition.php line 530ff:
if ( isset( $_POST[‘allow_anonymous’] ) ) {
$this->allow_anonymous = 1;
}
the property is always set to 1, if the post-parameter is set – even if it is set to 0.
Putting addnew.view.php line 131 in comments solves the problem.
But as changelog for version 3.0.5.2 mentions:
bug fix: unable to toggle “allow anonymous” setting in Pro version
that might introduce other problems? (I haven’t got the pro version yet) So changing the code in class.petition.php is probably the better way to fix it?
By the way, in addnew.view.php line 133 there is a typo:
<label for=”allow_anon” …
should read
<label for=”allow_anonymous” …
Anyway, a fix would be very helpful for our campaign as we rely on people publicly stating their support on our website.
Thank you for maintaining this plugin. It is a pleasure to work with well documented and supported open source tools.
