Section add access check uses wrong section for 'lock settings after'

Created on 22 May 2024, 4 months ago
Updated 5 June 2024, 4 months ago

Problem/Motivation

Consider a content type with following section and setup and overrides per entity allowed:

Section A (delta 0): allow new section after
Section B (delta 1): allow new section before and after
Section C (delta 2): allow new section before
Section D (delta 3): no new sections allowed

This should in 'Section add' buttons between Section A and B, en Section B and C, as expected for the override option on entities.
The buttons contain url with delta of the following section, thus delta 1 and 2 respectively.
Example display of the entity override below.

Using the second 'Section add' button will result in access denied, so the off-canvas widget doesn't open.
Upon investigation of the code, the access check load the section config of section 'delta -1' ( = 1 => Section B) and 'delta +1' ( = 3 => Section D). Obviously, the latter is wrong and explains the access denied.

Steps to reproduce

See "Problem/Motivation"

Proposed resolution

Dropping the '+1' in 'delta +1' to load the section after config, fixes the issue.

Remaining tasks

Perhaps a test might need to be updated or added.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium andreasderijcke Antwerpen / Gent

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024