Currently the results and meter templates don't know about the selected choice. The results template claims it does, but the code providing that flag seems to be broken. Attached will be a patch fixing that bug and allowing the meter template to know about the selected option as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kristiaanvandeneynde created an issue. See original summary.

kristiaanvandeneynde’s picture

Status: Active » Needs review
FileSize
3.63 KB

Status: Needs review » Needs work

The last submitted patch, 2: poll-2899927-2.patch, failed testing. View results

kristiaanvandeneynde’s picture

Patch works fine for me, not sure what's failing.

Berdir’s picture

The tests are now fixed.

+++ b/src/Form/PollViewForm.php
@@ -260,9 +266,7 @@ class PollViewForm extends FormBase {
       '#pid' => $poll->id(),
-      '#poll' => $poll,
-      '#view_mode' => $view_mode,
-      '#vote' => isset($poll->vote) ? $poll->vote : NULL,
+      '#vote' => $user_vote !== FALSE ? $user_vote['chid'] : NULL,

Removing those properties seems unrelated?

Having this tested would be nice.

kristiaanvandeneynde’s picture

idebr’s picture

Status: Needs work » Closed (duplicate)