The Needs Review Queue Bot → tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- Merge request !3558Issue #3122526: Pager links inside a modal do not open in the modal → (Open) created by acbramley
- Status changed to Needs review
almost 2 years ago 1:51am 28 February 2023 - Status changed to Needs work
almost 2 years ago 2:20am 4 March 2023 - 🇺🇸United States smustgrave
So using views_test_modal module from core
When I click the link (which has class use-ajax)
Modal opens
Clicking a page items renders some errorsApplying the patch
I get the same results.
Using content view with ajax turned off ( as the issue summary didn't mention turning it on)
- last update
over 1 year ago 29,438 pass - last update
over 1 year ago 29,573 pass - 🇦🇺Australia acbramley
Rebased onto 11.x and changed target. There was a conflict with 10.1.x that needed resolving first. Thanks to @larowlan for helping with the git foo.
- last update
over 1 year ago 29,948 pass - last update
over 1 year ago 30,381 pass - 🇮🇹Italy maurizio.ganovelli Arezzo
Using only this condition:
\Drupal::request()->get(MainContentViewSubscriber::WRAPPER_FORMAT) === 'drupal_modal'
seems to fail in some use cases.
I have a modal form with ajax submit and tableselect element with pager. Applying this patch, pager links get ajaxified and work well until a validation error occurs. During submit, request wrapper format is "drupal_ajax", so after validation fails condition does not pass and links don't have use-ajax class and data attributes anymore.
Adding this:
in_array(\Drupal::request()->get(MainContentViewSubscriber::WRAPPER_FORMAT), ['drupal_ajax', 'drupal_modal'])
make pager work also after a failed validation, but i don't know if this can have unwanted side effects. - 🇫🇷France nicodh
Tested with Drupal 10.2.6, it works well with pager inside modal and without views. I use pager render array like this :
[ '#type' => 'pager', '#route_name' => '<current>', ]
- First commit to issue fork.