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.
in some cases when avoiding layout by default of a content type, the Undefined offset error appears: $ section_number in Drupal \ layout_builder_lock \ LayoutBuilderLock :: preRender ().
Comment | File | Size | Author |
---|---|---|---|
#17 | 3121250-17.patch | 3.86 KB | swentel |
#15 | 3121250-15-fail.patch | 3.04 KB | swentel |
#11 | 3121250-11-fail.patch | 2.14 KB | swentel |
#7 | layout_builder_lock-undefined_section_number-3121250-6.patch | 721 bytes | mmaldonado |
Comments
Comment #2
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedHmm, is there a way to reproduce this easily? Although I guess it couldn't hurt to add more checks there, but would great to get that in a test :)
Comment #3
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedComment #4
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedHello, if it is as you say with a simple control before iterating it is resolved, so this error would be somewhat small. In my case I get the error in Drupal 8.8.3 when editing a content type that by default has 4 Sections and the 4 sections have the options selected:
and if it serves as info I have installed the modules: grid_layout, layout_builder_base, layout_builder_extra_templates, layout_builder_lock, layout_builder_modal, layout_builder_restrictions, layout_builder_styles and layout_library.
regards
Comment #5
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedOk thanks for the info and patch, will try to reproduce and review more next week!
Comment #6
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedthanks to you, nice weekend.
Comment #7
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedComment #8
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedComment #9
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedComment #10
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedSo good news, this error starts popping up as soon as you have 3 sections. Will see if I can write a test for it!
Comment #11
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedThis is a failing test. It will fail on the PHP notice.
There's a second problem I see. Even though the last section is configured to not show the add section links etc, it still shows it - even though the link behind gives access denied.
Comment #12
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedComment #14
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedThis patch fixes the notice, but proves that there's still a problem with links not being hidden like 'Add section' or 'Configure section'.
Comment #15
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedAnd now with patch ....
Comment #17
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedAnd this fixes it all.
Comment #19
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedAnd fixed, thanks for the report!
Will push another release too in a few minutes.
Comment #20
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedComment #21
mmaldonado CreditAttribution: mmaldonado as a volunteer commentedsuper, thanks .....