On a clients site that I was working on an interesting situation happened. We had a content type that contained an imagefield called 'field_photo'.

This had been assigned an image but at some point was deleted from the files table (in the database) and on disk but not in the defaults value. Lots of problems insued. Basically, I believe that Imagefield got into a recursive loop attempting to retrieve the default value, but I can only speculate. I have dumped the reliavent section of code from this node that shows how the array is becoming a recursive loop.

Is there any checks for invalid default images... any way if you need more information please let me know.

[field_photo] => Array ( [field_name] => field_photo [type_name] => producer_profile [display_settings] => Array ( [weight] => 11 [parent] => group_details [2] => Array ( [format] => hidden [exclude] => 0 ) [3] => Array ( [format] => hidden [exclude] => 0 ) [label] => Array ( [format] => hidden ) [teaser] => Array ( [format] => photo_tiny_linked [exclude] => 0 ) [full] => Array ( [format] => photo_original_default [exclude] => 0 ) [Teaser] => Array ( [format] => image_plain [exclude] => 0 ) [Full] => Array ( [format] => image_plain [exclude] => 0 ) ) [widget_active] => 1 [type] => filefield [required] => 0 [multiple] => 1 [db_storage] => 0 [module] => filefield [active] => 1 [locked] => 0 [columns] => Array ( [fid] => Array ( [type] => int [not null] => [views] => 1 ) [list] => Array ( [type] => int [size] => tiny [not null] => [views] => 1 ) [data] => Array ( [type] => text [serialize] => 1 [views] => 1 ) ) [list_field] => 0 [list_default] => 1 [description_field] => 0 [widget] => Array ( [0] => [file_extensions] => png gif jpg jpeg [file_path] => [progress_indicator] => bar [max_filesize_per_file] => [max_filesize_per_node] => [max_resolution] => 0 [min_resolution] => 0 [alt] => [custom_alt] => 0 [title] => [custom_title] => 0 [title_type] => textfield [default_image] => Array ( [filename] => field_photo.jpg [filepath] => sites/harvestmig.site.koumbit.net/files/imagefield_default_images/field_photo_1.jpg [filemime] => image/jpeg [source] => default_image_upload [destination] => sites/harvestmig.site.koumbit.net/files/imagefield_default_images/field_photo_1.jpg [filesize] => 7347 [uid] => 5 [status] => 1 [timestamp] => 1287085751 [fid] => 2148 ) [use_default_image] => 1 [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => [23] => [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => [36] => [37] => [38] => [39] => [40] => [41] => [42] => [43] => [44] => [45] => [46] => [47] => [48] => [49] => [50] => [51] => [52] => [53] => [54] => [55] => [56] => [57] => [58] => [59] => [60] => [61] => [62] => [63] => [64] => [65] => [66] => [67] => [68] => [69] => [70] => [71] => [72] => [73] => [74] => [75] => [76] => [77] => [78] => [79] => [80] => [81] => [82] => [83] => [84] => [85] => [86] => [87] => [88] => [89] => [90] => [91] => [92] => [93] => [94] => [95] => [96] => [97] => [98] => [99] => [100] => [101] => [102] => [103] => [104] => [105] => [106] => [107] => [108] => [109] => [110] => [111] => [112] => [113] => ...

Comments

ShaneOnABike’s picture

Btw to resolve this issue I basically ran the following script (it would be different for other people) on SQL:

UPDATE `content_node_field_instance` old1, `content_node_field_instance` new1 SET old1.widget_settings = new1.widget_settings WHERE old1.field_name = 'field_photo' AND old1.type_name = 'producer_profile' AND new1.type_name = 'point_of_sale';

This basically copies over the widget_settings from one content type to another to remove all the bad data.

sfyn’s picture

It would be helpful to know how the file was originally deleted from the files table, in order to reproduce...

quicksketch’s picture

This bug was caused by some older versions of CCK, I think it was corrected in the most recent versions. Are you running the latest version of CCK and ImageField?

quicksketch’s picture

Status: Active » Closed (cannot reproduce)

This problem had been happening for a lot of people for a short while. I *think* new versions of CCK corrected it, but as I never was able to reproduce the problem and there are no longer additional reports, I'm closing this issue.