Problem

An error occurs when accessing any pages beyond page 1 in the admin interface of the Protected Pages module on Drupal 11.

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /app/web/modules/contrib/protected_pages/src/Controller/ProtectedPagesController.php on line 101 in Drupal\Component\Utility\Html::escape() (line 431 of /app/web/core/lib/Drupal/Component/Utility/Html.php).

Steps to reproduce

  1. Navigate to /admin/config/system/protected-pages.
  2. If the list spans multiple pages, attempt to go to page 2 or beyond.

The above error is triggered.

Proposed resolution

The controller attempts to pass a null value to Html::escape(), which expects a string.

Data model changes

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

chandraraj created an issue. See original summary.

chandraraj’s picture

chandraraj’s picture

Status: Active » Needs review
kalpanajaiswal’s picture

This issue does not appear in the Drupal 11 environment.

alexander tallqvist’s picture

Ran into this bug today running Drupal 11.1.8 and Protected Pages 1.8. The patch provided in #2 seems to fix the issue.

saganakat’s picture

Status: Needs review » Reviewed & tested by the community

Works for me patch in comment #2 D11.1 and protected_pages: v1.9.

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

pfrenssen’s picture

Status: Reviewed & tested by the community » Needs work

Let's make a merge request so this can be merged by the maintainers.

pfrenssen’s picture

Version: 8.x-1.7 » 8.x-1.x-dev
Status: Needs work » Reviewed & tested by the community

Added the MR, I applied the patch from @chandraraj and fixed an unrelated coding standards error that popped up in the latest version of Coder. Setting back to RTBC because I did not make a change to the fix, just made it available as an MR.

oksana-c made their first commit to this issue’s fork.

oksana-c’s picture

Version: 8.x-1.x-dev » 3.x-dev
Status: Reviewed & tested by the community » Fixed

Merged. Thank you all!

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.

oksana-c’s picture

Status: Fixed » Closed (fixed)