Access check problems on add_to_template link

Created on 9 October 2021, about 3 years ago
Updated 13 September 2023, about 1 year ago

Problem/Motivation

In certain cases (did not have time to figure out the exact use-case) the access check on $add_template_to_library_url (https://git.drupalcode.org/project/section_library/-/blob/1.0.x/src/Sect...) will fail because the parameters are never set.

Proposed resolution

Surround the adding of the add to library link with a check to see if the params were actually set.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇪Belgium L_VanDamme

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium kriboogh

    update; we have been running this patch #6 in production for over 12 months now without issues.

  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    Waiting for branch to pass
  • 🇧🇪Belgium StefanieV

    Thanks for the patch @kriboogh.
    We ran into a different issue with this patch. The url path of the 'add to library' link for each section was always referring to the section with delta 0 (i.e. the first section on the page), which caused this link to always trigger a scroll up to, and save of, this first section instead of the relevant section where the link was clicked. The same behaviour happened for the 'Import from library', where the new section would be added as the first section of the page, regardless of between which sections the link was clicked.
    I reworked the patch of #6 for version 1.1.1.

Production build 0.71.5 2024