Closed (fixed)
Project:
Lexicon
Version:
7.x-1.9
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2012 at 12:42 UTC
Updated:
14 Jun 2012 at 09:31 UTC
Jump to comment: Most recent file
I have an error after updating from 1.8 version to 1.9 version of lexicon.
I have that in my php log error :
[06-May-2012 14:31:32] PHP Fatal error: Cannot access empty property in /Users/xav/Developpement/www/yogarik/modules/field/field.module on line 972
[06-May-2012 14:31:32] PHP Stack trace:
[06-May-2012 14:31:32] PHP 1. {main}() /Users/xav/Developpement/www/yogarik/index.php:0
[06-May-2012 14:31:32] PHP 2. menu_execute_active_handler($path = *uninitialized*, $deliver = *uninitialized*) /Users/xav/Developpement/www/yogarik/index.php:21
[06-May-2012 14:31:32] PHP 3. call_user_func_array(*uninitialized*, *uninitialized*) /Users/xav/Developpement/www/yogarik/includes/menu.inc:517
[06-May-2012 14:31:32] PHP 4. _lexicon_page($letter = *uninitialized*) /Users/xav/Developpement/www/yogarik/includes/menu.inc:0
[06-May-2012 14:31:32] PHP 5. _lexicon_overview($vocab = *uninitialized*, $letter = *uninitialized*) /Users/xav/Developpement/www/yogarik/sites/all/modules/custom/lexicon/lexicon.pages.inc:52
[06-May-2012 14:31:32] PHP 6. _lexicon_term_add_info($term = *uninitialized*) /Users/xav/Developpement/www/yogarik/sites/all/modules/custom/lexicon/lexicon.pages.inc:143
[06-May-2012 14:31:32] PHP 7. field_get_items($entity_type = *uninitialized*, $entity = *uninitialized*, $field_name = *uninitialized*, $langcode = *uninitialized*) /Users/xav/Developpement/www/yogarik/sites/all/modules/custom/lexicon/lexicon.module:1030
I apply a patch on the lexicon.module to correct this error, it's because the field_get_items expect the third parameters to not be empty (because of the dynamic use in
$entity->{$field_name}[$langcode]
I joined my patch to this post, i don't know if i'm the only one who have this problem... and hope there is no other bug after updating.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | lexicon.module.patch | 2.47 KB | xadag |
| lexicon.module.patch | 2.91 KB | xadag |
Comments
Comment #1
marty2081 commentedThanks for reporting. I added check to see if the field is configured before calling field_get_items(). The changes are in the dev branch.
Comment #2
xadag commentedI think this is a better patch syntax with diff -ruN
Comment #4
marty2081 commentedPlease explain why (!empty($somehting)) is better than ($something != ''), knowing that $something is either filled with a field_name or with '', since '' is set as the default value?
Comment #5
pheraph commentedI experienced the same error and after updating to the latest -dev the error didn't appear again. Thanks!
Comment #6
JoachimF commentedI experienced the same error also - issue went away when I rolled back to 1.8
Comment #7
marty2081 commented@JoachimF: I know that it goes away when you roll back. I would like to know if the fix in the dev version resolves the issue so I can make a new release.
Comment #8
gavmassingham commentedI had the same issue and problem is fixed by dev.
Comment #9
marty2081 commentedSo I conclude that this one is fixed then.
Comment #10
Dave Sandilands commentedI agree that the new dev version fixes this issue.