Postponed (maintainer needs more info)
Project:
Hierarchical Select
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2012 at 15:55 UTC
Updated:
8 Oct 2018 at 21:46 UTC
Jump to comment: Most recent
Comments
Comment #1
acrollet commentedI don't have time to fully investigate this issue now, but it appears to arise when the 'Maximum number of levels allowed' setting under the editability section of the widget settings doesn't match the number of levels present in the vocabulary. In my case, the vocabulary went three levels deep, but the max number of levels allowed setting was at 2. I'm not sure if the best approach for a fix is to
a) add a hook invocation on term creation to adjust the max levels allowed setting
b) modify the code to avoid the notice when things don't match up (and potentially check when generating the widget settings form)
c) some other approach.
Comment #2
kurtzhong commentedreally good information on this issue. thx. :)
Comment #3
janicak commentedHi there,
In addition to the Undefined offset error, I'm also encountering the following issue, so perhaps they are related...
Namely, if "allow creation of new terms" is selected, and jquery_update is enabled, the box for the next lower level disappears when the selection in the higher level changes and will not reappear.
I went through most of the variations of settings for the HS widget and jquery_update, disabled most other modules and fields. Same behavior with 7.x-3.0-alpha5.
Any help would be greatly appreciated!
Comment #4
mrpauldriver commentedWe are encountering the error mentioned in first post.
Is there any more insight into what is happening here?
Comment #5
wim leersIt'd be great if somebody could debug this and then provide a patch.
Comment #6
wim leers#1857366: Undefined offset: 1 în _hierarchical_select_hierarchy_generate() (line 1703... was marked as a duplicate of this issue.
Comment #7
summit commentedHi,
I do not see a patch here, thats why I set it to active and not "needs work".
Any news on this please? Is the shortterm-fix to set the 'Maximum number of levels allowed' setting under the editability section of the widget settings the same as the number of levels present in the vocabulary?
Greetings, Martijn
Comment #8
summit commentedHi,
I did set the 'Maximum number of levels allowed' setting under the editability section of the widget settings the same as the number of levels present in the vocabulary.
Still problems with this and error as stated..
greetings,
Martijn
Comment #9
Bitvark commentedHi,
I had similar problem with a standard drupal installation using taxonomy term reference field with hierarchical select widget.
Don't know if it's useful for you, anyway to get free from this notice I followed 3 steps:
1) I provided same number of levels for related vocabulary and hierarchical maximum number of levels allowed (as vocabulary had one level less, before).
2) Then, I returned in field widget setting and drupal showed me an additional level in table "Per-level settings for creating new terms".
3) Just saved widget settings and notice disappered.
Comment #10
Bitvark commentedComment #11
summit commentedHi,
This helped me a lot to get rid of this error with a Migration. The levels need to have an exact match!
but it appears to arise when the 'Maximum number of levels allowed' setting under the editability section of the widget settings doesn't match the number of levels present in the vocabulary. In my case, the vocabulary went three levels deep, but the max number of levels allowed setting was at 2. I'm not sure if the best approach for a fix is
greetings, Martijn
Comment #12
7thkey commentedhi there,
Is there any progress on this?
Is it a problem with the module or the library?
Cheers
Comment #13
7thkey commentedAdded as duplicate of this issue.
Comment #14
giupenni commentedSame problem
Comment #15
firfin commentedError also shows up if 'Enable level labels' is checked in widget settings and not every level has a label set.
To 'solve' this, simply set a label for all levels.
Comment #16
firfin commentedMarked #2197829: error as duplicate.
Comment #17
stefan.r commentedIf anyone has a fix, I'll be happy to review.
Comment #18
istavros commentedIn 7.x-3.0-beta8 if you change line 1895 from
$label = ($config['level_labels']['status']) ? t($config['level_labels']['labels'][$depth]) : '';to
$label = ($config['level_labels']['status'] && isset($config['level_labels']['labels'][$depth])) ? t($config['level_labels']['labels'][$depth]) : '';just like in line 1851, the error should go away.
And of course you could just have labels for all levels. I use Features to track the field settings so I just changed
to this
and it works fine.
Comment #19
goldIt has been a year since this issue saw any comments. I am unable to replicate the issue. Looking at the code in #18 this is not currently in the codebase either.
If this is still an issue could someone please edit the description to give instructions to replicate the issue starting from "Install Drupal with the Standard profile". If you could also mention the version of PHP you're testing on that may also help.
I'm happy to generate a patch from the suggestions above, but I first need to see the error in action so I can see that the updates fix it.
Cheers.