Problem/Motivation

When creating a view with a block display, if you click on the "Allow settings" link within "Block settings", it provides a checkbox for "Items per page". You can check this box, and save the view. Then when loading the view in the UI fresh, that checkbox does not stay checked.

Steps to reproduce:
* Take any View with a block display
* Open the 'Allow settings' dialog
* Uncheck the 'Items per page' checkbox
* Click Apply
* Save the View
* Open the 'Allow settings' dialog
* Check the 'Items per page' checkbox
* Click Apply
* Save the View
* Verify: The Views UI will show that Items per page is enabled (so storing the selected value works as expected)
* Open the 'Allow settings' dialog
* The check box is not checked

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch created an issue. See original summary.

quicksketch’s picture

Status: Active » Needs review
FileSize
1.45 KB

Here's a patch that solves the problem.

Status: Needs review » Needs work

The last submitted patch, 2: 2958673-1-ajax-double-attach-d8.patch, failed testing. View results

quicksketch’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 8.6.x-dev » 8.x-3.x-dev
Component: views.module » Code
Status: Needs work » Active

Sorry that was the wrong patch. I'm still working on this and will upload it when ready.

quicksketch’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.6.x-dev
Component: Code » views.module
drclaw’s picture

Version: 8.6.x-dev » 8.8.x-dev
Status: Active » Needs review
FileSize
680 bytes

array_keys() should do the trick?

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

keesje’s picture

Status: Needs review » Reviewed & tested by the community

Could reproduce issue. Patch in #6 applies cleanly on 8.9.x and fixes this issue.
Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs tests

I've tried to reproduce this on 8.9.x and I can't reproduce the issue.

I installed standard and visited admin/structure/views/view/who_s_new and clicked on items per page link and changed it and pressed and then changed it again and everything worked as expected.

It'd be great to add a test.

keesje’s picture

@alex thanks. I could only reproduce it with a newly created view, not with an existing one. Maybe should have mentioned that. Will look into test.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now 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: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

raman.b’s picture

Adding some test coverage to demonstrate the reported bug

The last submitted patch, 13: 3012704-13-test-only.patch, failed testing. View results

Lendude’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Nice, great to see test coverage for this.

Updated the IS with some more extensive steps to reproduce, because it took me some clicking to reproduce it too. But could reproduce it and this fixes the problem.

The last submitted patch, 13: 3012704-13-test-only.patch, failed testing. View results

  • catch committed 40e34c8 on 9.2.x
    Issue #3012704 by raman.b, quicksketch, drclaw, keesje, alexpott,...

  • catch committed 6211032 on 9.1.x
    Issue #3012704 by raman.b, quicksketch, drclaw, keesje, alexpott,...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.