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.
Hello!
Notice: Undefined offset: 1 in select_or_other_field_formatter_view() (line 451 in /sites/all/modules/select_or_other/select_or_other.field_widget.inc).
Such an error I get in dblog.
I have 4 fields with different settings in my content type, so can settings of each of them help to solve error?
Comment | File | Size | Author |
---|---|---|---|
#5 | select_or_other-undefined_offset_1_in-2596057-5.patch | 1.02 KB | Zekvyrin |
Comments
Comment #2
legolasboWhat you can do is try to reproduce the error on a vanilla Drupal installation. Start with the select or other field, and add the other fields one by one. Note the step's you've taken until you start seeing the error. If you post these steps I can reproduce (and solve) the issue.
Comment #3
Zekvyrin CreditAttribution: Zekvyrin commentedThis can happen when displaying the value using "select or other widget":
If "Other" is not selected (and the textfield is empty) but the field has other values selected, there is an entry in the table without data (without the character '|'). But because there are data in the field, $pos returns the position of the first line and stops there.
What should be done is check the position of '|' character in every line.
I'm uploading a patch...
Comment #4
Zekvyrin CreditAttribution: Zekvyrin commentedComment #5
Zekvyrin CreditAttribution: Zekvyrin commentedSorry, forgot to close a parenthesis in previous patch.
Comment #8
legolasbo@Zekvyrin,
Thanks for your interest and the patch.
That said, I think you are taking the wrong approach to solving this issue.
What should actually be done is the following:
|
gets saved to the db in the first place.|
values from the db.Comment #9
legolasboI am unable to reproduce this issue in either 2.x or 3.x. Please provide clear steps to reproduce on vanilla Drupal.
Comment #10
legolasboWhile working on something else I found how to reproduce the issue. Working on a fix.
Comment #14
legolasboFixed the issue by making sure no empty lines are saved.
Comment #19
kaztur CreditAttribution: kaztur commented@legolasbo, sorry, didn't have a time to test.
So, cann't follow the thread of issue (possibly because of ny bad english) - is issue fixed with module update or should I apply the patch from #5 by Zekvyrin?
Comment #20
legolasboIt's fixed in the latest dev version, but there might be some regressions from other issues as I am currently rewriting the module.
Comment #22
quimicCan we expect a 2.x release with this issue fix?