Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Since the introduction of pager_settings this settings are not stored.
To reproduce:
- Create a view
- Change the pager settings, for example the items per page
- Export it/change the pager settings again, and you will see that nothing changed
Bug was found by dagmar1
Comment | File | Size | Author |
---|---|---|---|
#14 | views-test_pager_settings.patch | 4.06 KB | dawehner |
#11 | views-652712.patch | 2.34 KB | dagmar |
#6 | views-652712.patch | 1.94 KB | dagmar |
#3 | views-652712.patch | 1.91 KB | dagmar |
#1 | views-652712.patch | 1.03 KB | dagmar |
Comments
Comment #1
dagmarThe problem was that views_display_plugin::option_definition was defining the 'items_per_page' (this should be removed in pluggable pagers patch) so, when init() function called $this->get_option('items_per_page') the default value was loaded and not the defined values from UI.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedHm. I think this can't be removed, because otherwise old format stuff will not be properly converted. Instead we must add 'export' => FALSE to these lines. It should be really easy to test this, but I'm pretty sure I had to leave those definitions to make sure that the data would be read properly.
Comment #3
dagmarYes it make sense. So, only perform the conversion if the items_per_page, offset, or use_pager doesn't contains default values.
Comment #4
dagmartagging
Comment #5
dawehnerSry, but this patch doesn't fix this for me :(
Comment #6
dagmarYes, you was right, I only tested it with a default display, but when I click override this doesn't work anymore. New patch, here is my view export, it seems to be working fine now.
Comment #7
dawehnerI just testet a bit. I still does not store / change the pager settings.
I'm using DRUPAL-6--3
Comment #8
figover CreditAttribution: figover commentedPlz exmplain the issue.
" 1. Create a view
2. Change the pager settings, for example the items per page
3. Export it/change the pager settings again, and you will see that nothing changed
"
Did u save the view after changing pager settings ?
Comment #9
dagmar@figover, dereine is the comaintainer of views for Drupal 7, he knows what is he doing :)
@dereine, I'm changing the status of this issue to critical because we need this fixed to test
#324092: Expose: Items per page and Offset
#268023: Limiting total number of items....
Can you provide a more detailed information the steps to reproduce the bug?
I'm doing this:
Apply the patch.
Create a view:
Set Pager -> Full pager, settings changed
Create a new display
Override
Set Pager -> Mini pager, settings changed
And it is working fine... this is weird
Comment #10
dawehnergit reset
patch apply
edit frontpage view
- it does not work
add new view
- it does store the changed settings.
Comment #11
dagmarThe good thing is we have ultra tested this issue :)
So I finally can replicate, when a views was saved with previous values, like Views Bulk Operations with admin/content/node2 contains a value different to 10 as items per page, so it is not the default value. When the view is edited views_plugin_display::init() converts the old values into a new plugin pager, but, items_per_page, offset and use_pager are still here. So when the views is saved, both, new and old values are saved, but then. Views is initialized again, and since old values are still there, pager is loaded as a conversion of the old values.
Solution?
Comment #12
dawehnerjuhuu this patch works now :)
Comment #13
bwynants CreditAttribution: bwynants commentedworks like a charm! thanks!
Comment #14
dawehnerHere is a simpletest for it. There are still two failies, but quite some stuff works.
Comment #15
merlinofchaos CreditAttribution: merlinofchaos commentedOk, tests (even with fails) and patch committed to 6.x; needs to be rerolled for 7.x -- note that I added a missing comma in the patch in an array().
Comment #16
merlinofchaos CreditAttribution: merlinofchaos commenteduntag
Comment #17
dawehnerdepense on http://drupal.org/node/586668
Comment #18
dawehneri included this patch, too, because this fixes really a lot of bugs.