Hello.

I have installed v. 5.x-1.x-dev of this module. Created a new content type, created a initial node with it, filling out questions and answers.

Upon submission, poll was not visible on the new page.

When I try to create a Content Template for the new content type, I can see the $node->field_vote (array) contents, and they correctly reflect the poll. It is just not added to the page when viewing the node.

Here is a sample of my new node type exhibiting this issue: http://www.timhudak.ca/atlantic-round-1-robert-borden-vs-jack-pickersgil...

Thank you

Comments

karens’s picture

Pollfield has a unique way of displaying the results so you may need to change the way you identify it in your Contemplate. What code did you use in your template to display the field?

brianV’s picture

Thank you for replying, KarenS.

I was told that it would show up at the top of the node regardless of what Contemplate I used. Here is the code:

<p>
  <span style="width: 430px" class="inline center">
    <a href="/great-dominion-dust">
      <img class="image img_assist_custom" src="/files/images/Banner_430X75.jpg" border="0" alt="Great Dominion Dust-Up Banner 430X75" title="Great Dominion Dust-Up Banner 430X75" width="430" height="75" />
    </a>
  </span>
</p>
<p align="center">This page is part of <a href="/great-dominion-dust">The Great Dominion Dust-Up</a> .</p>

<table border="0" cellpadding="5"> 
  <tbody>
    <tr>
       <td width="50%" valign="top">
        <?php print $node->field_politician_a_bio[0]['value'] ?>
      </td>   
      <td width="50%" valign="top">
        <?php print $node->field_politician_b_bio[0]['value'] ?>
      </td> 
    </tr> 
  </tbody>
</table>   

The fields I have available w.r.t. the pollfield are:

$node->field_vote (array)

    $node->field_vote[0] (array)

        $node->field_vote[0]['question']
            Who is Canada's more inspiring politician? 
        $node->field_vote[0]['active']
            1 
        $node->field_vote[0]['runtime']
            0 
        $node->field_vote[0]['choice']
            Robert Borden 
        $node->field_vote[0]['votes']
            0 

    $node->field_vote[1] (array)

        $node->field_vote[1]['question']
            Who is Canada's more inspiring politician? 
        $node->field_vote[1]['active']
            1 
        $node->field_vote[1]['runtime']
            0 
        $node->field_vote[1]['choice']
            Jack Pickersgill 
        $node->field_vote[1]['votes']
            0 

Am I supposed to add somethign else to the Contemplate?

senpai’s picture

I can verify that the problem exists, I just don't know what to do about it. I'd offer a patch if I could figure out what the bloody was going on here.

Virgin sandbox site with CCK(everything). Create a new content type. Use three fields, a couple of multi-choice inputs, and a pollfield.

Create Content > New Poll. Add info to every field that requires it. Poll does not show on submission of new content.

Hmmm.

I canna understand why it doesn't display. And I'm not even using Contemplate! :=)

karens’s picture

To display the pollfield in custom themes and templates you need to use:

print content_format('myfield', $node->myfield);

Don't use $node->field_politician_a_bio[0]['value'] or any such value, and don't use foreach(). Content_format needs the whole pollfield, not one item at a time.

brianV’s picture

Those politican_bio fields are just other content field in the node.

So in this particular example, I would call

print content_format('field_vote', $node->field_vote);

I have been trying this, and it is outputting nothing. I have also tried with the single quotes around 'field_vote' removed.

Thank you for the reply!

senpai’s picture

So it sounds like a theme issue, not a code issue. Brian, I'll try this fix in a Garland site soon and report back for ya.

moshe weitzman’s picture

Priority: Normal » Critical

i can confirm this problem, and it is happenning with garland and without contemplate.

interestingly, the problem resolves itself when the node is edited. but when you first create a poll, $node->content['field_poll'][0][#value] is empty.

karens’s picture

Oh... now that gives me something I can investigate. Thanks!

karens’s picture

Status: Active » Fixed

I think I finally found the problem and committed a fix.

Anonymous’s picture

Status: Fixed » Closed (fixed)
giorgio79’s picture

Version: 5.x-1.x-dev » 6.x-1.13-beta1
Component: Code » Miscellaneous
Category: bug » support
Priority: Critical » Normal
Status: Closed (fixed) » Active

Hello Guys,

I am trying this in D6, but having no luck with

print content_format('field_vote', $node->field_vote);

Contemplate gives me nothing for this.

Any tips?

bryan kennedy’s picture

Version: 6.x-1.13-beta1 » 5.x-1.x-dev
Status: Active » Closed (fixed)

Hey giorgio79. I closed this again and set the version back to 5.x-1.x-dev.

This issues was resolved over three years ago in the Drupal 5 version of the module which is no longer supported.

If you having an issues with the 6.13-beta1 version and contemplate, please go ahead and create a new issue with a bit more detail than what you've provided here.