Hi,

There is a bug in pagination in the core. the steps are below along with screenshot.

- Create more content
- From admin/content click on last from the pagination.
- Select all records of the last page let's say page 51.
- Perform bulk delete.
- You are on page 50 but you see No content available. where the content really exists.

Any workaround to make the better user experience as of now.

I didn't find component pager so keeping this under system.module.

pagination

Comments

RavindraSingh created an issue. See original summary.

cilefen’s picture

Component: system.module » views.module
henriquebauer’s picture

Assigned: Unassigned » henriquebauer
henriquebauer’s picture

Version: 8.3.x-dev » 8.4.x-dev
StatusFileSize
new1.49 KB

Hi, I created a patch to fix it. It's working for me on Drupal 8.4.x.
Please, review and test.

henriquebauer’s picture

Status: Active » Needs review
henriquebauer’s picture

Assigned: henriquebauer » Unassigned

Status: Needs review » Needs work

The last submitted patch, 4: 2921519-4-8.4.x.patch, failed testing. View results

henriquebauer’s picture

StatusFileSize
new1.43 KB

Ignore the previous patch.
This is the correct.

henriquebauer’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: 2921519-8-8.4.x.patch, failed testing. View results

RavindraSingh’s picture

Path seems improving. but till the time there is a workaround I just did.

/**
 * Altering the pagination 
 */
use Symfony\Component\HttpFoundation\RedirectResponse;
function MODULENAME_views_pre_render(\Drupal\views\ViewExecutable &$view) {

 $current_uri = \Drupal::request()->getRequestUri();
 $currentPageValue = \Drupal::request()->query->get('page');
 $currentPage = $view->getCurrentPage();
 if(!empty($currentPageValue) && is_numeric($currentPageValue)):
   if($currentPageValue > $currentPage):
   $current_uri = \Drupal::request()->getRequestUri();
   $oldPageNo = "page=".$currentPageValue;
   $newpageNo = "page=".$currentPage;
   $newURL = str_replace($oldPageNo, $newpageNo, $current_uri);
   // Redirect user on new and correct URL.
   $response = new RedirectResponse($newURL);
   $response->send();
   endif;
 endif;
}

I will review the patches sometime later.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dharmendart’s picture

Can you please post patch for Drupal 7 . I am getting same problem in Drupal 7

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

junkuncz’s picture

StatusFileSize
new1.47 KB

I added some changes to the last patch, at first sight it seems good to me in 8.7.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

johnv’s picture

Title: Pagination doesn't return me on previous page when deleting the content from last page. » Views pager doesn't return to previous page when deleting the content from last page
Status: Needs work » Needs review
johnv’s picture

Title: Views pager doesn't return to previous page when deleting the content from last page » Pager doesn't return to previous page when deleting the content from last page
Related issues: +#3323574: Pager not working correctly in AJAX view with exposed filters

This sounds like an identical/similar problem as #3323574: Pager not working correctly in AJAX view with exposed filters, which prposes a solution in core/modules/views/js/ajax_view.js
Is it?

oily’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

Updated the IS but more extensive edits are required.

smustgrave’s picture

Status: Needs review » Postponed (maintainer needs more info)

Anyone experiencing this see if the issue mentioned in #24 solves this. If no response this could be closed out in 3 months.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
Issue tags: +Bug Smash Initiative

Came up as a daily BSI target

Since there's been no follow up to #26 going to close out. If still a valid bug please re-open.