Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
now the question of the poll is in the title of the block/box, which makes it multiline (problem with some skins). Wouldn't it be better to have a short title, and another field with the question? (and some explanation maybe)
Comments
Comment #1
al CreditAttribution: al commentedThis has been patched up by Kobus for the CVS trunk, but I'm not sure he's happy about the way he's done it (it should probably be using title/body/teaser, not add a custom db field). See http://lists.drupal.org/pipermail/drupal-devel/2003-April/023229.html for details.
Comment #2
Kobus CreditAttribution: Kobus commentedI will take this feature update for 4.1.0 (Official release). I'll also look in 4.1.0 branch in CVS as well as CVS version of Drupal, but going to do this one first in the correct manner.
Regards,
Kobus
Comment #3
Kobus CreditAttribution: Kobus commentedKristjan,
You mentioned before that I could reuse the $node->body or $node->teaser field. I saw that $node->teaser was used already, so, I decided on $node->body, however, I can'ty figure out how this can be done without altering the poll table, as you sit with this query:
db_query("INSERT INTO poll (nid, runtime, voters, active) VALUES ('%d', '%d', '', '%d')", $node->nid, $node->runtime, $node->active);
There are no references to the node table in any of the SELECT, INSERT or UPDATE db_query instructions, so, I can't see how this is possible to do it the way you suggested by reusing the fields? You may assume that I am stupid and inexperience, because I am!
Would it really be a problem to create the extra field in the poll table?
Regards,
Kobus
Comment #4
al CreditAttribution: al commentedNeeds to have $node->body = [foo] added to it, where [foo] is the question text, obviously. You'll want to modify poll_teaser() and other things, obviously.
Updates to node objects aren't done using SQL statements - all that's handled for you by the base node class. I suggest you take a look at the book module for a more straightforward view of how to override node stuff.
Comment #5
al CreditAttribution: al commentedComment #6
Steven CreditAttribution: Steven commentedThe sideblock title is fixed, I don't see how/why we should fix the main node title.
Comment #7
Gabriel R. CreditAttribution: Gabriel R. commentedQuestions and explanations are most of the time pretty long. I think that not having separate fields for title/question is a real problem.