I created a binary poll having 4 choices/ 1 answer. As an admin, everything shows up and works fine.
Given access to authenticated users to "vote on polls" and "view polls", an authenticated user sees the node, sees the 4 radio buttons, but instead of the choices' text he only sees n/a behind the radio buttons. Hard to vote, then.
I let the node object show up, and in some array leaves the choices' text appear, in others it doesn't. In short:
Here the choices appear (shortened code):
stdClass Object
(
[choice] => Array
(
[1] => Array
(
[label] => My first choice
)
Here it does not:
stdClass Object
(
[content] => Array
(
[poll] => Array
(
[#value] => <form action="/wu-x/node/380" method="post" id="advpoll_voting_binary_form-0" class="advpoll-vote">
<div><div class="poll">
<input type="hidden" name="ajax" id="edit-ajax" value="" class="ajax" />
<div class="form-radios"><div class="form-item">
<label class="option"><input type="radio" name="choice" value="1" class="form-radio" /> n/a</label>
</div>
Here it does not either:
stdClass Object
(
[#children] => <form action="/wu-x/node/380" method="post" id="advpoll_voting_binary_form-0" class="advpoll-vote">
<div><div class="poll">
<input type="hidden" name="ajax" id="edit-ajax" value="" class="ajax" />
<div class="form-radios"><div class="form-item">
<label class="option"><input type="radio" name="choice" value="1" class="form-radio" /> n/a</label>
</div>
I put a print_r($node) into the node-advpoll_binary.tpl.php file and send you the entire output as an attached file.
| Comment | File | Size | Author |
|---|---|---|---|
| nodeobject-advpoll-binary-5.x-1.0-beta5.txt | 9.32 KB | marcor |
Comments
Comment #1
ChrisKennedy commentedHmmm thanks for the bug report, this appears to be a problem with _advpoll_check_markup()'s call to check_markup(), which is being called in advpoll_voting_binary_form().
Now that I look at it, in the binary version we try to do an access check on the choice titles when previewing, but in the ranking version we don't.
Anders?
Comment #2
anders.fajerson commentedI guess another of those "I don't use rankings that much" mistakes. Since the preview check wasn't the format check defaults to TRUE, rendering it like N/A for users without permissions to view the filter format. Good call.
http://drupal.org/cvs?commit=83710
Comment #3
anders.fajerson commentedCorrect version.
Comment #4
ChrisKennedy commentedMarcoR's having the problem with binary polls though. I would think we need to actually remove the filter check from both types.
Comment #5
anders.fajerson commentedI see. Well, at least in theory the filter check should be off (FALSE) when viewing polls (both types now). Could you reproduce this?
Comment #6
ChrisKennedy commentedI haven't reproduced it yet. I'm guessing it happens when the voter doesn't have access to the default input format for whoever created the poll. I haven't tried checking $node->in_preview yet, but maybe in_preview isn't defined and !isset($node->nid) would be better.
Comment #7
anders.fajerson commentedThat should have been adressed in a previous bugfix (pretty sure it was before beta 5 though).
MarcoR , can you downoad the latest release and see if problem is still there?
Comment #8
marcor commentedThank you very much! :) This works fine now. But the common jquery actions don't work anymore (compared to the beta5 version I used before). So with javascript enabled I cannot reveal some options when editing. But this is another issue and I can access everything with javascript turned off.
Comment #9
(not verified) commented