Load pages from pager within active modal

Created on 26 March 2020, about 5 years ago
Updated 30 January 2023, about 2 years ago

If a pager is rendered within a modal, also open other pages/links within the modal.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Ajax 

Last updated about 1 hour ago

Created by

🇦🇺Australia dpi Perth, Australia

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 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.

  • Status changed to Needs review about 2 years ago
  • 🇦🇺Australia acbramley

    Rebased onto an MR and added additional tests.

  • Status changed to Needs work about 2 years ago
  • 🇺🇸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 errors

    Applying the patch

    I get the same results.

    Using content view with ajax turned off ( as the issue summary didn't mention turning it on)

  • 🇫🇮Finland lauriii Finland

    Posted review on the MR

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update almost 2 years ago
    29,438 pass
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update almost 2 years 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
  • Pipeline finished with Success
    over 1 year ago
    Total: 785s
    #26968
  • 🇮🇹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.

  • Pipeline finished with Failed
    over 1 year ago
    Total: 174s
    #74576
  • Pipeline finished with Success
    over 1 year ago
    Total: 563s
    #74577
  • Pipeline finished with Failed
    over 1 year ago
    Total: 746s
    #74580
  • Pipeline finished with Success
    over 1 year ago
    Total: 567s
    #74585
  • 🇫🇷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.
  • 🇮🇳India sakthi_dev

    Rebased and resolved the conflicts.

  • Pipeline finished with Failed
    11 months ago
    Total: 176s
    #172673
  • Pipeline finished with Failed
    2 months ago
    Total: 127s
    #413992
  • Pipeline finished with Failed
    2 months ago
    Total: 533s
    #414007
  • Pipeline finished with Success
    2 months ago
    Total: 1791s
    #414042
  • Status changed to Needs review 2 months ago
  • 🇦🇺Australia acbramley

    Ready for another review.

  • 🇺🇸United States smustgrave

    Left some comments in the MR.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 447s
    #447955
  • 🇦🇺Australia acbramley

    Feedback addressed, I tried to find why we were using olivero and I think it was mainly to demonstrate the fix works there but I think Stark makes more sense.

  • 🇺🇸United States smustgrave

    Drupal\Tests\file\Functional\DownloadTest pretty sure unrelated.

    Rest of the feedback appears to be addressed.

  • 🇮🇳India gaurav.kapoor

    +1 RTBC, works fine when the modal has a pager.

  • Status changed to Needs work 5 days ago
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024