When i go click " My Account" there is an error, it displays this:
•Notice: Undefined property: stdClass::$title i galleryformatter_field_formatter_view() (linje 186 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 194 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$title i galleryformatter_field_formatter_view() (linje 186 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 194 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$title i galleryformatter_field_formatter_view() (linje 186 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 194 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$title i galleryformatter_field_formatter_view() (linje 186 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 194 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$title i galleryformatter_field_formatter_view() (linje 186 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 194 af /home/www/xxx.xxxxxxx.xx/sites/all/modules/galleryformatter/galleryformatter.module).
And i got Entity API 7.x-1.0-beta8 + Entity tokens 7.x-1.0-beta8 enabled
How can this be fixed
Pafla
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 1120712-12-undefined_property.patch | 649 bytes | twistor |
Comments
Comment #1
manuel garcia commentedCan you check if this is still happening using the latest dev release for D7?
Comment #2
pafla commentedYes, sorry i did not tell that i was using the latest d7 dev release from 29-3-2011.
and i just cheked, it is the same in firefox like ie8.
Comment #3
manuel garcia commentedComment #4
pafla commentedWhen i was asking in chat i was been recommenden always to take those in green, but i have just tried 7.x-1.x-dev and then errors have changed i bit:
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 192 af /home/www/d7a.tipsmodforsikring.dk/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 192 af /home/www/d7a.tipsmodforsikring.dk/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 192 af /home/www/d7a.tipsmodforsikring.dk/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 192 af /home/www/d7a.tipsmodforsikring.dk/sites/all/modules/galleryformatter/galleryformatter.module).
•Notice: Undefined property: stdClass::$nid i galleryformatter_field_formatter_view() (linje 192 af /home/www/d7a.tipsmodforsikring.dk/sites/all/modules/galleryformatter/galleryformatter.module).
Comment #5
manuel garcia commentedWell, I'm sorry but I cannot reproduce this problem on the latest 7.x dev (2011-Mar-26).
The line numbers in those errors don't correspond to any calls to an object. Even more, line 194 of galleryformatter.module is a blank line...
Comment #6
pafla commentedI think it is a mistake line 186+194 is in 7.x-1.0 - line 192 is in 7.x-1.x-dev
Line 192 is $slideset_id = $field['field_name'] . '-' . $entity->nid;
Comment #7
manuel garcia commentedOops, we cross-posted there.
Yes, usually you use the ones in green for production, but if you find a bug, it's normal to test the latest development version and see if it has been fixed there already (the dev version will become the next stable version normally).
I do see $entity->nid in line 192, but this has the NID in my install... something weird is going on in your installation. I have installed entity api and entity token but that doesnt seem to have any effect.
Comment #8
pafla commentedI don´t know what this mean, but when i change line 192 in 7.x dev (2011-Mar-26).
What does . '-' . $entity->nid; mean
Change from
$slideset_id = $field['field_name'] . '-' . $entity->nid;
-to-
$slideset_id = $field['field_name']; // . '-' . $entity->nid;
Then the error disappear
Comment #9
manuel garcia commentedPafla what entity is your image field being attached to? The user? A content type?
Can you provide more information, configuration, screenshot etc about how the field is setup please? It's so that I can try reproducing it on my side to troubleshoot =)
Comment #10
pafla commentedi made a image field in user account
What does this in thread #8 mean
Comment #11
manuel garcia commented$slideset_id = $field['field_name'] . '-' . $entity->nid;is used for setting the unique slideset id... the$entity->nidis normally the node id, but its giving out that notice because in your case, there is no node, but a user id.Since this module in d6 was only used on nodes, I did not think of d7 fields, which are able to attach themselves to any entity, be it a node, a user, a taxonomy, or whatever.
Many thanks for reporting, and taking the time to follow up on the report Pafla, I'll see what I can do as soon as I get some quiet time to study this, and try to generalize the module for any type of entity.
Comment #12
twistor commentedThis patch gets rid of the stated problem. The only other thing I see is using $entity->title.
Comment #13
twistor commentedComment #14
manuel garcia commentedI've given some this thought, and was reluctant to use entity_extract_ids, since this is called once per image in your patch:
At first I committed common use-cases for node, user and taxonomy entities, in order to avoid calling that function so many times. But then I realized we could just take that out of the foreach loop, have it call only once per gallery, and have a single line for all entity types. Relying on that api call also makes the code more sustainable.
In any case, this is now fixed, and will be available in the next stable release (or in dev if you cant wait). Thanks twistor!
Comment #16
jjcarrionI used the patch in my project and the error disappeared, but also the images disappeared.
At last, I have installed the development version and it has worked everything correctly.
Comment #17
manuel garcia commented@jjcarrion Thank you for reporting, I think I'll make another stable release of 7.x soon.
Comment #18
pafla commented