Closed (duplicate)
Project:
ImageField
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2007 at 12:02 UTC
Updated:
17 May 2007 at 22:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
energie commentedhere is the 5-1 patch
Comment #2
dopry commentedtnx, committed to 4-7 and 5. I forgot all about the unset stuff making it into content.module. hooray for and older bug going away.
Comment #3
yched commentedActually I'd recommend keeping the empty value for $delta = 0, in order to actually store in the db that the field is empty.
Someting like
if (empty($node_field[$delta]) && $delta >0)- see text.module or nodereference.moduleWith the patch above, empty fields are not consistently stored in the db :
no record if the field is stored in a field table (multiple or shared field)
a record with the 'default' value for the db column if the field is stored in a content-type table
And then for instance, you cannot accurately filter empty fields in a view.
Yet another aspect of multiple fields that would be better off handled in content.module...
Comment #4
dopry commented@yched, How does that work out... I should have at least one value of 0 in a multivalue table? can you give me a quick recipe to test the effect?
Comment #5
yched commentedI should have at least one value of 0 in a multivalue table?
Yes - but content.module does not really enforce that, that's rather my personal opinion in order to have consistent db storage and views filtering.
If you do not do that, and the field is stored in a per-field table, then the field is not really empty, it simply does not exist for the node.
Sorry for paraphrasing my previous post, I'm not sure I understand your question ;-)
Comment #6
edrex commentedMy content_field_images table has no record for some nodes, and the 0-record for some.
The first group renders fine, the second renders a broken img tag like
Some vids have up to 5 0-records in the table (deltas 0-4) and nothing else. AFAIK nodes with multiple zero-values render ok.
Basically, imagefield is keeping a very sloppy table, this needs some care.
Comment #7
edrex commentedForgot to put my markup in a <code>, oops. I only noticed this because I use konqueror, which shows an icon for broken images. You all must be FF users :P

Comment #8
edrex commentedah crap, I forgot to entify... that seems like alot of work. So when rendering it's treating the empty field as though it had a valid image path etc, so the path ends up being bogus.
Comment #9
jpetso commentedAs far as I can see, this issue concerns the same database inconsistency that I tackled in issue #88136 with a pretty comprehensive patch. Also see the corresponding filefield issue (which is exactly the same problem as this one) on what's wrong, and how I tried to overcome it.
Given the patches and other attempts in the mentioned issues, I'll be frank and close this one as duplicate.