Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
4.7.x-1.x-dev
Component:
content.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2007 at 23:40 UTC
Updated:
6 Feb 2007 at 23:16 UTC
Jump to comment: Most recent file
Comments
Comment #1
yched commentedthe related issue is here : http://www.drupal.org/node/107128.
Basically, a richer UI now allows users to customize the way their fields are displayed.
To account for these settings, content.module now provides a 'standard' field display method, and hook_field('view') is not called anymore, unless a field module explicitly opts-out and provides his own.
Thus for most field modules (and all of 'core' cck feilds), the 'view' op can go.
theme_field has changed internally, but its fingerprint is the same as before, and AFAICT existing tpl.php files should not break either.
Comment #2
yched commentedI just checked in a fix for a small bug in 4.7 that broke the display of field labels for content types whose 'display options' have not been set yet.
But the variables that were available in previous template files are still there, and the
foreach($items as $item) { ...$item['view']... }construct definitely still works (and is still the right way)Comment #3
karens commented@killes, good idea about 'no patch without an issue'. That also provides sort of an announcement system for anyone subscribing to the CCK issues queue that will let people know a patch has been committed when the issue is marked fixed.
Did yched's patch fix your problem?
Comment #4
yched commentedhttp://drupal.org/node/111979 has been marked a dupe of this - there seems to be an issue indeed, probably with contemplate.
Comment #5
karens commentedI'm not clear if killes was using contemplate or not, so I don't know if that was his issue, but there is definitely something broken in contemplate. It has a function function theme_contemplate_field() that needs to be updated. It is using the old theme formatting defaults.
I reactivated the duplicate issue, since it specifically mentioned contemplate, and moved it to the contemplate issue queue. I didn't want to move this issue since I can't tell if it is related to contemplate or not.
Comment #6
killes@www.drop.org commentedI don't use contemplate and I didn't dare to update the site I was breaking by the update yesterday again. :p
Comment #7
karens commentedI found the real problem, the previous commit was a red herring that was not the issue. We did in fact lose the 'view' item in the node array with the recent changes to the way teasers are handled. I'm working on an update now. There is also a legitimate contemplate issue, and I'll propose a patch there when I get done with this one.
So don't do any updating until we get this working right. I'll post here when I have something.
Comment #8
karens commentedComment #9
karens commentedHit the wrong button :-(
Here is a patch for HEAD, I will post a patch for 4.7 in a minute.
Comment #10
karens commentedHere's the patch for 4.7.
I'm going to do a bit more testing to be sure before committing these.
Comment #11
karens commentedCommitted with one small change ($field_name as undefined). This also seems to fix the contemplate issues except for the theme function, so I'll post a patch over there for that.
Comment #12
karens commentedCommitted to all branches.
Comment #13
yched commentedGood catch, I overlooked the fact that we had to update the $node once we're done.
However I'd like to submit what I think is a better fix :
- it is more coherent with the way other 'field array walking' functions work : update the $node only when all the fields have been walked.
This also prevents us to encourage field.tpl.php files to get the field values from an incomplete $node : they should get the values from the $items array.
- it has the node passed by ref to the content_field_view function - currently the node does not get updated either outside of the function :-)
- it also corrects another (future) bug I introduced when calling the field 'view' op : module_invoke cannot pass by reference, that's why JonBob used the $function(...) stuff.
Same thing, I'll try to further test before committing.
Comment #14
yched commentedBTW, I'm thinking of refactoring these 'field array' walking functions (content_field_invoke, content_field_invoke_default, content_widget_invoke, content_field_view) into using one iterator function. Not for the next release, obviously, but I'll add it to the 'laundry list'.
Comment #15
killes@www.drop.org commentedI can confirm that it is fixed, thanks.
Comment #16
yched commentedcommitted the patch in #13 to both branches
Comment #17
(not verified) commented