Problem/Motivation

ActivationCheck::isActive() calls Request::get(), which is deprecated in Symfony 7.4 and removed in Symfony 8.

Steps to reproduce

  1. Run PHPStan on src/ActivationCheck.php with Symfony 7.4: it reports the deprecated call.
  2. Call isActive() with Symfony 8: it fails with an undefined-method error.

Proposed resolution

Read the request parameter bags directly, preserving the existing precedence: attributes, query parameters, then POST parameters. Only the literal value no disables GLightbox.

Add tests for flag values and precedence. Local tests pass on Drupal 10 and 11; a separate Symfony 8 runtime check also passes.

Remaining tasks

Review and merge the MR.

Issue fork glightbox-3628791

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nick hope created an issue. See original summary.

nick hope’s picture

Assigned: nick hope » Unassigned
Issue summary: View changes
Status: Active » Needs review

levmyshkin made their first commit to this issue’s fork.

  • levmyshkin committed 07a6a014 on 1.0.x authored by nick hope
    fix: #3628791 Replace deprecated Request::get() in activation check
    
    By...
levmyshkin’s picture

Status: Needs review » Fixed

Thanks @nick hope! Reviewed and merged into 1.0.x.

Review notes:

  • The new lookup matches Symfony's own Request::get(): attributes first (a NULL value counts as present), then query, then POST. It reads values via all()[$key], so array values don't hit the InputBag::get() exception.
  • All 14 new unit tests pass on Drupal 11.3.13 / Symfony 7.4.14 / PHP 8.4. Running the same tests against the old Request::get() implementation also gives 14/14, which confirms there is no behavior change.
  • Confirmed Request::get() triggers a deprecation in Symfony 7.4. There are no other Request::get() calls in the module.
  • PHPCS (Drupal, DrupalPractice) is clean for both changed files.

Committed as 07a6a01.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

levmyshkin’s picture

Status: Fixed » Closed (fixed)