Add pagination to target revision candidates list

Created on 8 October 2021, about 3 years ago
Updated 31 January 2024, 10 months ago

Problem/Motivation

If there are multiple revisions then it takes a long time to load.
Given that only the ones at the top of the list will be used its best to paginate the revisions.

Steps to reproduce

Create multiple revisions ( greater than 500 )

Proposed resolution

Paginate the results as shown in the attached image.

Remaining tasks

User interface changes

Add pager type to the form "src/Form/Entity/ScheduledTransitionAddForm.php"

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇦🇺Australia mayurngondhkar Melbourne

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

Comments & Activities

Not all content is available!

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

  • 🇦🇺Australia Nadim Hossain

    Hi,
    I have fixed the above issues that I mentioned during testing. I have turned off the drupal form validation for the checkbox,tableselect that are used to select the different revision version. As this is using ajax to load the dynamic options, the drupal for validator create issues. Looks like a common issue in drupal when using ajax. Couple of suggestions that helped me are from the following links -
    Reference 1
    Reference 2

    This is the field that was creating issue - revision tableselect

    Also from the previous patch this part was added to show and select the latest revision only for the 1st page of the pagination, but I think it should be shown at the top of every pagination page, that is why I have reverted back the changes to default. Following code is from the previous patch -

    +    // Add the latest revision if this is the first page of results.
    +    if ($this->database->getPagerManager()->getPager()->getCurrentPage() === 0) {
    +      $options = [
    +        static::LATEST_REVISION => [
    +          'revision_id' => [
    +            'data' => $this->t('Latest revision'),
    +          ],
    +          'state' => [
    +            'data' => $this->t('Automatically determines the latest revision at time of transition.'),
    +            'colspan' => $entity instanceof RevisionLogInterface ? 4 : 1,
    +          ],
             ],
    -      ],
    -    ] + $options;
    +      ] + $options;
    +    }

    I have tested my new patch locally, but need someone else to review this and then we can move this to testing.
    Thanks

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Patch Failed to Apply
  • 🇬🇧United Kingdom johan.gant Belfast, UK

    Re-rolled #11 to work against 2.3.x

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    52 pass, 2 fail
  • 🇦🇺Australia Feng-Shui

    Re-rolled #12 against 2.4.x

Production build 0.71.5 2024