OK. I have a fix for this. If you need it urgently, edit /wp-content/plugins/speakout/includes/class.petition.php
At line 828 find a function retrieve()
with the following code ( you may have removed line 838 as a workaround )
public function retrieve( $id )
{
if( !is_numeric( $id )){ return; }
global $wpdb, $db_petitions, $db_signatures;
$sql = "
SELECT $db_petitions.*, COUNT( $db_signatures.id ) AS 'signatures'
FROM $db_petitions
LEFT JOIN $db_signatures
ON $db_petitions.id = $db_signatures.petitions_id
AND ( $db_signatures.is_confirmed != '0' )
WHERE $db_petitions.id = $id
GROUP BY $db_petitions.id
";
$petition = $wpdb->get_row( $sql );
$rowcount = $wpdb->get_var( $sql );
if ( $rowcount > 0 ) {
$this->_populate_from_query( $petition );
return true;
}
else {
return false;
}
}
// get all Active Campaign lists for Add New View dropdown
We are adding a conditional statement that is called only if confirmations are disabled, in this case, it counts all signatures.
public function retrieve( $id )
{
if( !is_numeric( $id )){ return; }
global $wpdb, $db_petitions, $db_signatures;
$sql = "
SELECT $db_petitions.*, COUNT( $db_signatures.id ) AS 'signatures'
FROM $db_petitions
LEFT JOIN $db_signatures
ON $db_petitions.id = $db_signatures.petitions_id
AND ( $db_signatures.is_confirmed != '0' )
WHERE $db_petitions.id = $id
GROUP BY $db_petitions.id
";
$petition = $wpdb->get_row( $sql );
$rowcount = $wpdb->get_var( $sql );
// this is a workaround to fix signature count for early installs that have confirmed enabled, then later disabled confirmations
if($petition->requires_confirmation == 0){
$sql = "
SELECT COUNT( $db_signatures.id ) AS 'signatures'
FROM $db_petitions
LEFT JOIN $db_signatures
ON $db_petitions.id = $db_signatures.petitions_id
WHERE $db_petitions.id = $id
GROUP BY $db_petitions.id
";
$rowcount = $wpdb->get_var( $sql );
$petition->signatures = $rowcount;
}
if ( $rowcount > 0 ) {
$this->_populate_from_query( $petition );
return true;
}
else {
return false;
}
}
// get all Active Campaign lists for Add New View dropdown