Also reported by lrobeson, http://drupal.org/node/1110180#comment-4375962

Related to #652712: Pager settings are not stored. In that issue it looks like pager settings were fixed on a per display basis, and I do not see any changes to the code although I haven't looked that in-depth. As an unrelated issue, tests written for pagers are broken now as well.

I'll try to look for a git commit that regressed this as it was reported working by Dereine in the issue noted above.

Steps to reproduce

  1. Create a new view.
  2. Create a couple of block displays.
  3. Try to override the number of items per page for each display. It will change the option for every display instead of just for the overridden display.

Also, I tried modifying a view template with the items, and it views imports it with the same items per page regardless (although that template may be incorrectly formatted). In other words, I exported the example view, try to add those lines to the display, re-import, but that does not work either.

Attached a view to try out. I can't take screenshots well on this windows box (ugh) so I don't have any. Issue confirmed on two different installations by two different people Today as well as the note by lrobeson.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Sadly i can reproduce this.

fandb’s picture

I can reproduce this as well.
Although References display appears to work properly.

mradcliffe’s picture

Title: Pager items: Items per page cannot be overridden (regression) » Items per page cannot be overridden without first overriding pager (regression?)

After undergoing some more manual testing I was able to override pager items only when I first overrode the pager type. (Long post incoming)

This makes sense with the following work flow:

#1

  1. Set pager Full.
  2. Set number of items to N.
  3. Switch to display X.
  4. Override pager Full for display X.
  5. Set number of items to M for display X.

But not with this one:

#2

  1. Set pager Full.
  2. Set number of items to N.
  3. Switch to display X.
  4. Override number of items to M for display X.

Confusingly, you can override number of items without first overriding the pager if you have a cloned display where the pager is already overridden.

#3

  1. Set pager Full.
  2. Set number of items to N.
  3. Switch to display X.
  4. Override pager Full for display X.
  5. Override number of items to M for display X.
  6. Clone display X as display Y.
  7. Override number of items to L for display Y.

But if you clone a display that has not already overridden the pager, it works as above in #2.

So the question becomes:
Should overriding the settings for a pager (and other plugins?) override the pager itself, or should the work flow in #1 and #3 be a part of Views use documentation?

Edit: This makes sense to me as-is, but it is confusing if you come at making views from #2. I think that stronger docs or explanation as part of overriding would help.

dawehner’s picture

You can only override the pager itself, because it's the only way to be sure that the options mean what you mean in your pager plugin and the options are attached to the plugin.

OldAccount’s picture

Subscribing

dawehner’s picture

Assigned: Unassigned » merlinofchaos
FileSize
2.12 KB

Some stuff:

* items_per_page, offset still exist in quite some places in the code. Here is a patch for it.

In general i have no idea how this defaultable_section etc. stuff works.
Earl please here here.

geek-merlin’s picture

confirming and subscribing

dawehner’s picture

Status: Active » Needs review
FileSize
1.94 KB

Update status and bump for merlinofchaos. It's really hard for me here.

Here is the new version

merlinofchaos’s picture

Try this patch and see if it works

merlinofchaos’s picture

Try this:

mradcliffe’s picture

I am a little crunched for time at the moment, but I will try when I can myself.

dawehner’s picture

Okay, fixed the override button by reverting another commit.

Now this patch works fine. Added the pattern to access and cache plugin and removed the items_per_page setting again.

steinmb’s picture

The patch seems sound and safe, but I'm a bit out of my depth when it comes to Views code base. From a usability point of view (ehem...) does this now make sense, and pager override work just fine on our installations.

Thanks :)
Stein

dawehner’s picture

Status: Needs review » Needs work
+++ b/plugins/views_plugin_display.incundefined
@@ -427,16 +427,6 @@ class views_plugin_display extends views_plugin {
       ),
-      'items_per_page' => array(
-        'default' => 10,
-      ),
-      'offset' => array(
-        'default' => 0,
-      ),
-      'use_pager' => array(
-        'default' => FALSE,
-        'bool' => TRUE,

This shouldn't be removed, because this would bork the automatic update from views2

Powered by Dreditor.

dawehner’s picture

Status: Needs work » Fixed

Commited to 6.x-3.x and 7.x-3.x with a comment about legacy code.

Status: Fixed » Closed (fixed)

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