Problem/Motivation

Follow-up from #3348789: Compress ajax_page_state.

 // Once we have validated the required parameters, we restore the parameters
    // from the request since there might be additional values.
    $state->replace($query->all());

Ideally this would use an allow-list of query parameters instead of grabbing everything out of the query.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

catch created an issue. See original summary.

yonailo’s picture

I am seeing duplicate "&page" parameters when we use the pagination of the media library widget, I think

    if ($query->has('page')) {
      $query->remove('page');
    }

woud be needed as it has recently been done with "ajax_page_state" .... I dont understand why the grabbing of all the query string parameters is done here :(

neclimdul’s picture

Feels like maybe the whole train of issues down that link are caused by this and the complexity it causes. Probably need to fix the underlying issue instead of chasing our tail trying to fix every edge case caused by it.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.