Closed (won't fix)
Project:
Content Construction Kit (CCK)
Version:
6.x-1.x-dev
Component:
Views Integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2007 at 13:56 UTC
Updated:
1 Oct 2009 at 15:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
markfoodyburton commentedPlease use the following patch which enables independence from the views module, and use the editablefields module ( http://project/editablefields )
Comment #2
markfoodyburton commentedthat should be http://drupal.org/project/editablefields
Comment #3
karens commentedThere are basically two things in this patch, one small and one much more significant.
1) You want to add a field 'editable' to all CCK fields if your module is enabled. This is a problem for several reasons:
a) If someone creates a field and later enables your module, and then creates some data and then later disables your module, the CCK methods of keeping track of what fields have what values will be a complete mess as your value appears and disappears from the field.
b) We don't use any 'if (module_enabled)' code in CCK, except for Views and path auto because those two are so widely used. For all other modules we ask for module developers to find a way of using hooks in their own module to accomplish things. If we added in 'if (module_enabled) for every module that does anything with CCK (and there are many many many requests for that) the CCK code would become really unwieldy. I know you'd prefer to have that value automatically there, but if there is no reason for it to exist outside of your module, it's hard to make a case that it belongs in the core code.
The good news is there is already a way to do this. Formatters were designed to be altered by other modules, so you can create a hook_formatter_info() function in your module and enable your editable field for all the CCK fields you want to support.
2) The second, and more complex, part of the patch is a change to the way CCK handles widget_invoke. It may well make sense to break this up so it is invoked for every field, but it also has the potential to create all kinds of maintenance problems if it introduces any bugs. On top of that, the widget handling is probably going to be completely rewritten for 6.x (or at least have some significant changes) so making any big changes for 5.x is not high on anyone's list. We're already having trouble finding enough time to keep up with the issue queue and get the 6.x port working.
I'm very interested in what you're doing with your module, and you know I already offered to try to incorporate it into Views Calc, so I'm not trying to be negative, just realistic about making changes to CCK that make it more difficult to maintain. And I'm open to arguments/feedback, especially if yched or dopry have any thoughts.
Comment #4
markfoodyburton commentedI'll check up on the hook - I would prefer that mechanism, sorry I didn't find it myself.
For the bulk of the patch - the only alternative is to replicate the code in the module - of course I can do this, but it's not so nice I dont think. Anyway - maybe we should do this to make sure it's stable. (BTW, you'll see the patch is really just a factoring of the code, it doesn't change anything, just moves it about a bit)
For 6, I hope you can provide functions like this straight away, then I can remove the code replication :-)
I'll work on the module again over the next few days :-)
Comment #5
markfoodyburton commented(Sorted the hook - easy, once I saw through the mist)
So, I have copied the code from cck into the new module - replicating code is a bad thing, however, given the state of the world....
This patch is no longer required.
Comment #6
moshe weitzman commentedComment #7
karens commentedThe 6.x port has changed the way widgets are handled in a way that I think will work for your purposes. There is a separate function to add a single field to a form that you should be able to invoke. See http://drupal.org/node/157176 for info on the state of the changes.
Comment #8
markfoodyburton commentedI think this looks perfect.
One of the motives for the code I have written was the ability to add more items to a list. The new way of handling multiple values will ease that. However, building a "list of nodes" is still useful - which really requires a view to find the right nodes - so a "multiple node-reference" with a link to a view, and a means for adding a new one would be ideal. - this is basically what I've done in the module I've written, but it addresses the problem from the "views" end, rather from the "cck node-reference" end.
I think, in the fullness of time, when I get round to moving across to 6.x, changing this and building a mechanism for handling multiple node references would be really nice.
Thanks a lot for the work on 6.x, it looks really good.
Comment #9
karens commentedChanging the title and version to reflect the remaining issue, now that the 6.x code allows for individual field elements.
Comment #10
markus_petrux commentedPretty old thread and editablefields is already able to do its job.