Hello
Thank you for your feedback.
We were able to identify the problem and fix it.
It’s going to take a couple more days to release a new version that contains the fix so I have included the fix below
In plugin editor, edit abstract_model.php under models folder
look for the line below
__construct( $id = 0, $is_view_results = "no", $question_sort = "poll_order", $question_sort_rule = "ASC", $answer_sort = "question_order", $answer_sort_rule = "ASC" )
and replace this code
if($id=="-2"){
$filters = array();
$filters[] = array(
'field' => 'poll_type',
'value' => 'poll',
'operator' => '='
);
$filters[] = array(
'field' => 'poll_start_date',
'value' => current_time( 'mysql' ),
'operator' => '<='
);
$args = array(
'return_fields' => 'ID ',
'filters' => $filters,
'search' => array(
),
'orderby' => "poll_start_date",
'order' => 'DESC'
);
$total_polls = Yop_Poll_Model::get_polls_filter_search( $args );
$id=$total_polls[count($total_polls)-1]['ID'] ;
}
with this one
if($id=="-2"){
$filters = array();
$filters[] = array(
'field' => 'poll_type',
'value' => 'poll',
'operator' => '='
);
$filters[] = array(
'field' => 'poll_start_date',
'value' => current_time( 'mysql' ),
'operator' => '<='
);
$args = array(
'return_fields' => 'ID ',
'filters' => $filters,
'search' => array(
),
'orderby' => "poll_date",
'order' => 'ASC'
);
$total_polls = Yop_Poll_Model::get_polls_filter_search( $args );
$id=$total_polls[count($total_polls)-1]['ID'] ;
}
Please let us know if that fixes your problem.
Best
YOP Team