I have 2 content types : photo and photo_gallery. In the photo type, there is one nodereference field (widget: reference from url) that will reference the photo_gallery nodes.
I then add one nodereference count field in the photo_gallery to show the number of photos in each gallery. In the field configuration page, after saving, I got the error message:
Notice: Undefined index: photo_gallery in nodereference_count_field_options() (line 39 of ***/sites/all/modules/nodereference_count/nodereference_count.module).
Even though there is the above error message, everthing works fine. The result of photo numbers is showing correctly and there is no other error messages elsewhere.
Comments
Comment #1
gilgabar CreditAttribution: gilgabar commentedThanks for spotting this. I was able to reproduce and the fix should be pretty straightforward, but please test it out to be sure. Try replacing line 39 with this:
The issue is that there is another node reference field that was created before your photo_gallery content type existed, so the photo_gallery type name does not appear in that field's list of referenceable types (it doesn't matter whether it is selected or not). The patch just makes sure that the index for the type name is set before it checks to see if it is also selected.
Comment #2
danny1997 CreditAttribution: danny1997 commented@gilgabar :
I just tested the above codes. It removes the error notice and everything works fine now.
Thanks for your help.
Happy new year!
Comment #3.0
(not verified) CreditAttribution: commentedadd : widget type is reference from URL