After an image field is added to library item content type it gives
Fatal error: Allowed memory size of x bytes exhausted (tried to allocate 32 bytes) in .../library/library.module on line 398
After an image field is added to library item content type it gives
Fatal error: Allowed memory size of x bytes exhausted (tried to allocate 32 bytes) in .../library/library.module on line 398
Comments
Comment #1
tutumlum commentedI try to investigate and found that in function library_form_alter $form_state returns this:
Array(
[storage] =>
[submitted] =>
[post] => Array()
[item_count] => Array(
[field_bookcover] => 0
)
)
to fix it change line 162:
- if (isset($form_state['item_count'])) {
+ if (isset($form_state['item_count']) && !is_array($form_state['item_count'])) {
I do not know there is better way or not but it works for me.
Comment #2
jastraat commentedI can't recreate this problem.
Could you be more specific as to the order of the actions you took? (Please order the following)
Create a content type
Add the content type to the library
Add an image field to the library.
And what specifically were you doing when you got the error? Did you get it as soon as you clicked on node edit?
Are you using the most recent version of the module, and did you upgrade from an earlier version?
Are you using the most recent versions of filefield/image field?
What is your PHP memory limit? While you only need 16MB for Drupal core, I wouldn't try to run library + CCK + Filefield + Imagefield with anything less than 64MB and 128 would be better.
Comment #3
tutumlum commentedMy surrent php memory is 256MB. After I got the error I increased PHP memory limit up to 1024MB, but still the same.
Yes I am using the last version of filefield/image field modules.
I am using 6.x-2.x-dev version with date 2010-Nov-23 of Library module.
I reproduce the error on clean drupal install with following steps:
- Clean install of Drupal6
- install modules cck, filefield, image field, library, ImageAPI with the last versions
- make the build in "page" content type "library item",
- add new "file field" with operation "image" and name as "coverpage" and save,
- Do not tick "Display this field in the library" and save the field,
- go to create content > page
you will see the error.
to fix it change line 162 of library.module as I mentioned above.
Comment #4
jastraat commentedAh - it was on node create, not edit. Was able to reproduce. And tested the fix mentioned above which worked. Will make the change to the 6.x-2 branch.
Thanks!
Comment #5
jastraat commented