I needed a CCK pollfield for a couple of projects I'm working on so I have created a pollfield module. It has all the functionality of the core poll module but as a CCK field so you can add one or more pollfields to any content type. I have it working in both 4.7 and 5.x.

My question is whether I should create a separate project for this or should it be in the core CCK package? I only ask because the poll module is a core module, otherwise I would just make a project for it. It makes no difference to me one way or the other, just trying to get a feel for the best way to go.

Comments

fago’s picture

As the poll module is even in drupal core, I would include it with CCK.
On the long road I personally would prefer to have the poll field even in drupal core instead of the poll content type.

moshe weitzman’s picture

I could go either way on this. U just want to subscribe to the issue. I need this module (for drupal5) within a week or two. Go Karen!

moshe weitzman’s picture

I should add that i just need regular old poll features . No need for Views and such. All I need is to add a textfield to a poll with a long question but the core poll node type is locked and can't be extended.

yched’s picture

I have to admit mixed feelings at the idea of another field module in cck core.
The way I (only personally...) see it, polls are not really a 'basic' datatype. They're in drupal core, but rather on their way out it seems, because 'advanced poll' module and votingAPI-based solutions seem more promising.
There was the idea of a 'voting api' field some time ago. If / when it comes, won't it makethe "core" pollfield obsolete as well ?

On the other hand, it seems that your pollfield will have some specific stuff regarding Views integration ? That might provide a good example of default behaviour override - no core module currently make use of CONTENT_CALLBACK_CUSTOM - if it could override the default 'view' bahaviour, it would be even better ? :-)

karens’s picture

I decided to just go ahead and make a project for it. It can always be pulled back into the core package later if anyone wants to. The project is at http://drupal.org/project/pollfield. You can add one or more pollfields to any content type, and all the poll values are Views-enabled so you can create a Views view of questions and responses.

It obviously needs testing, but seems to generally be working right. There is both a 4.7 and a 5.x version.

And, yes, it does use a lot of the custom handlers so it is a good example of that -- custom view, custom default value, and custom Views tables (I need to get back to that issue and post the patch for the content module side of that, but it works even without a patch since it will just overwrite the tables that the content module creates.)

catch’s picture

Status: Active » Fixed

Marking as fixed :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.