Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-1.x-dev
Component:
content.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2006 at 15:16 UTC
Updated:
1 Jul 2009 at 11:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
eaton commentedWhoops. a bit of cruft from an earlier version of this tweak snuck in.
Comment #2
karens commentedYep, no question we can do better, I just wanted to get something functional committed. And yes, the existing node array should be useful here, using the field weight values that have been broken for so long :-)
Anyone who understands how CCK works is welcome to jump in with suggestions or patches. I plan to take a look at this later if no one else does.
Comment #3
talltim commentedOut of interest, will this make it easier to render fields into separate fieldsets or tabs?
Comment #4
karens commentedI came up with a fairly simple way to incorporate field weights into both the form array and the new content array by making a couple changes to widget_invoke and field_invoke. There are other ways this could be done, but I'm going to post this one as a patch instead of committing it to see if anyone has better ideas or other feedback.
Comment #5
eaton commentedKaren, that looks very smooth; thanks for taking a look at this! The 5.0 version is definitely looking good. I can say that the approach you're taking for building the content array is very good, though I can't testify to how well it meshes with existing CCK code. I'll do some additional testing on my end.
In the future, it might be worth noting that the elements in the content array can themselves be themed. The following:
... Would by default pass the entire 'my_field' element into them('cck_date_field', $node->content['my_field']).
That's probably overkill at the moment, but the possibility is certainly open in the future.
Comment #6
moshe weitzman commentedAs a future enhancement, we could easily offer role based access control on fields using the #access property. we need to enforce this access control on forms and upon viewing cck node.
Comment #7
karens commentedIs there some documentation somewhere about things like the #type and #access properties and how they work? I couldn't find anything. It would make sense to take advantage of as much functionality as possible, and make sure we're building the array in a way that is as easy as possible for other modules to manipulate the data.
Comment #8
moshe weitzman commentedi don't see docs for those either.
#access is really easy. it is just like the menu system where the valeu is an expression which must be true in order to show the form field or rendered value.
Comment #9
karens commentedI went ahead and committed this. It's a pretty simple fix that shouldn't break anything else and it uses the field weights which have never worked right and also gets the content array into a format that it can be accessed and manipulated by other modules to add other features, like field level access control. I'm also going to alter the 4.7 version with the change to the form array, since that part of this fix will work in that version.
Comment #10
(not verified) commentedComment #11
kenorb commentedhttp://drupal.org/project/contemplate