Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following message appears once and a while in the log:
Notice: Undefined index: in languagefield_field_prepare_view() (line 139 of languagefield.module).
Google showed me one other site that shows the message.
Comment | File | Size | Author |
---|---|---|---|
#3 | languagefield_2029971_notice.patch | 675 bytes | johnv |
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedUr... johnv
Was this meant to be?
i.e.
Comment #2
johnvYou're right. The interface of _languagefield_options() changed on 28-oct-2012 with this commit.
Comment #3
johnvAttached patch is committed here.
Comment #4.0
(not verified) CreditAttribution: commented.
Comment #5
ericmulder1980 CreditAttribution: ericmulder1980 commentedI am still seeing this issue for nodes where the languagefield has not been set, i.e. - None - is selected. In my case the nodes are automatically generated with an import script, perhaps that is one of the reasons.
diving into the code i see that $item['value'] is set to FALSE which means it tries to retrieve $languages[FALSE] which does not exist.
Perhaps it is good to check the existence of $item['value]?
Above code takes away the notices for me. This means that $items[$id][$delta] would never be set. I am not really sure what the implications for this could be. Perhaps it is better to return LANGUAGE_NONE when $item['value'] is not set to a valid language?
Comment #6
ericmulder1980 CreditAttribution: ericmulder1980 commentedRe-opened this issue since (in my case) it is still active.
Comment #10
johnvI prefer to not make assumptions. The default value of the field may be another value. So I committed your first version (slightly changed).
Thanks.