Multiple routes/paths are not well extracted from settings

Created on 5 October 2023, over 1 year ago

Problem/Motivation

On /admin/config/infinite-scroll/settings page, you can add urls/routes where to apply those settings. One url/route per line.
The explode function extracts individuals route/path but they are not cleaned enough to match actual route/path.

Steps to reproduce

Add multiple routes/paths in settings (with all other settings well set!): infinite scroll stops working.

Proposed resolution

In pager_infinite_scroll.module, line 18, change
$routes = explode(PHP_EOL, $settings['routes']);
to
$routes = array_map('trim', explode(PHP_EOL, $settings['routes']));

Patch is attached.

PS: for those coming here because of "it's not working" issue, please also note that paths should be written unaliased (like /node/xxx) and wildcards are not supported.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

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

Comments & Activities

  • Issue created by @PhilY
  • Status changed to Needs review over 1 year ago
  • πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France
  • @phily opened merge request.
Production build 0.71.5 2024