Jefferson49 / Joomla_plugin_sexypolling_reloaded

Migration of the joomla plugin "Sexy Polling" to joomla 4.x
GNU General Public License v3.0
2 stars 3 forks source link

End date of poll is not correctly handled if option "Show Results During Poll" is set to "no" #85

Closed Jefferson49 closed 6 months ago

Jefferson49 commented 6 months ago

Observed with v5.0.3/5.1.2 and Joomla 4/5

Was initially mentioned in issue #82

When the Show Results During Poll setting is set to No, the text from the language string COM_SEXYPOLLING_WORD_26 that says "Your vote has been registered, you may see the results starting" becomes inconsistent with the actual functionality.

To prevent this, I suggest splitting the language string into two separate strings - one that says "Your vote has been registered!" and another that says "You may see the results starting ". That way, whether the Show Results During Poll setting is Yes or No, there shouldn't be any inconsistency. Does this seem like a good idea to you?

Jefferson49 commented 6 months ago

The code in helper.php seems to wrongly checking the date_end against '0000-00-00'. However, should be checked against the current date.

// disable results till poll is ended
if($polling_array[0]->showresultsduringpoll == '0' and $polling_array[0]->date_end != '0000-00-00')
    $hide_results_ids[$poll_index] = $polling_words[25] . HTMLHelper::date(($polling_array[0]->date_end ?? ''), $stringdateformat, $data_time_zone);