uswds_preprocess_pager nukes all changes made to hrefs

Created on 11 April 2024, 7 months ago

Problem/Motivation

Cannot modify the URLs in view pager links because they're generated from scratch by `uswds_preprocess_pager` without regard to any modifications made previously.

Steps to reproduce

  • Implement `hook_preprocess_pager($variables)` in a module.
  • Modify any of the `href` keys in the `$variables['items']` array.

Proposed resolution

Provide a means to either preserve changes made to URLs, or to alter the items array before it's implemented, or to pass in options to be implemented by the `uswds_preprocess_pager` function.

Remaining tasks

Come up with a better fix than what I'm attaching here.

API changes

In my patch, I'm allowing `#options` to be passed in and used througout the items array.

πŸ› Bug report
Status

Active

Version

2.7

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States emanaton

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

Comments & Activities

Production build 0.71.5 2024