Is this a know bug? i searched queue and didn't see anything close.

I just upgraded a site from 6.x-2.9 to 3.0-alpha3 and although things seem to generally work i see that none of the pager settings where caught as all my views are now set as the defaults of 10 items, paged.

Comments

liquidcms’s picture

Title: pager settings lost fo all viewas when updating from 6.x-2.9 to 3.0-alpha3 » pager settings lost for all views when updating from 6.x-2.9 to 3.0-alpha3
dawehner’s picture

Well it's an alpha :)

If you expect less bugs please try out the dev version. There are around 150 less bugs in the dev version, just a short assumption

liquidcms’s picture

sounds good. thanks.

liquidcms’s picture

Version: 6.x-3.0-alpha3 » 6.x-3.x-dev

retested update a couple times with latest dev version and still no luck... so sounds like a bug.

bumped version here to -dev

liquidcms’s picture

as a small side note.. it also looses override settings for pager for all displays

i.e. some of my displays have different pager settings - after update, all are set to use default which is set to enable paging, and unlimited number of items to show

dawehner’s picture

can you show an example view?

Did you saved the view in the meantime?

In theory the loaded views should automatically be moved to the new settings.
In general you should move from 6.12 to 6.x-3.x-dev. So please try to redo the steps in your development enviroment.

liquidcms’s picture

hmm.. ok.. yes i have the view and no i wasn't using 6.12 i was using a 2.x-dev from Feb so i could get clone display feature.

later today i'll try going to 6.12 and then 3.x-dev

liquidcms’s picture

StatusFileSize
new8.48 KB

one of the views in question is attached

dawehner’s picture

Status: Active » Needs work
StatusFileSize
new716 bytes

|Yeah it's reproduceable with this view

$view = new view;
$view->name = 'car_icons';
$view->description = 'Icons for the home page, New, Future, Used secondary nav blocks';
$view->tag = '';
$view->base_table = 'node';
$view->core = 0;
$view->api_version = '2';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => 'Title',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'nid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 1,
      'text' => '[title]',
      'make_link' => 1,
      'path' => 'reviewsbycategory/new/[nid]',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'category' => 'category',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('footer_format', '1');
$handler->override_option('footer_empty', 0);
$handler->override_option('items_per_page', 0);
$handler = $view->new_display('block', 'Home page icons', 'block_1');
$handler->override_option('fields', array(
  'title' => array(
    'label' => 'Title',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('items_per_page', 9);
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'New Cars Sec-Nav', 'block_2');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'reviews/New Cars/[title]/all',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('footer', '<?php
print l( \'All\',\'reviews/New Cars/All/all\');
?>');
$handler->override_option('footer_format', '3');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'Used Cars Sec-Nav', 'block_3');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'reviews/Used Cars/[title]/all',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('footer', '<?php
print l( \'All\',\'reviews/Used Cars/All/all\');
?>');
$handler->override_option('footer_format', '3');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'Future Cars Sec-Nav', 'block_4');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'reviews/Future Cars/[title]/all',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('footer', '<?php
print l( \'All\',\'reviews/Future Cars/All/all\');
?>');
$handler->override_option('footer_format', '3');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

The patch fixes the "unlimited" part.

liquidcms’s picture

cool.. will try it out. thanks.

dawehner’s picture

What was the result of your try-out?

dawehner’s picture

Issue tags: +update-23

Add a random tag

liquidcms’s picture

hey. sorry never got a chance to try out your patch... tough one to test.. lol.. i will need a snapshot of a Views 6.12 site that i cold then go and upgrade.. as i manually just went through on the project above and reset the defaults.

willing to assume your patch works :) (mostly since most of my work is in D7 now).

dawehner’s picture

StatusFileSize
new1.01 KB

Here is a new patch. Some testing would be really helpful.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.81 KB

This time with improvement to readability and some more code comments.

dawehner’s picture

Status: Needs review » Fixed

Commited. Thanks chx for reviewing the patch and make suggestions.

MasterChief’s picture

Priority: Normal » Major
Status: Fixed » Needs work

I just downloaded the new version 6.x-3.x-dev, and it breaks all pagers, i can just save display all items in views use pager option even when i choose Display a specified number of items; so pager is broken.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new871 bytes

This might fix it. Some testing would be cool.

David D’s picture

#18 patch fixes it for me. Thanks!

MasterChief’s picture

Status: Needs review » Reviewed & tested by the community

I tested it and i confirm it works fine!

myxelf’s picture

At least on D7.x sites, this is breaking things badly. Views depending on pagers to show large amounts of information (teaser listing of +400 nodes, will probably run out of memory).

The D7 solution is incomplete. After upgrading to latest D7.x-dev #17 started to happen. Confirming #18 fixes the new issue.

HTH
MyXelf

hswong3i’s picture

Confirm that #18 works for me, too ;-)

willvincent’s picture

Here's a p0 version of dereine's patch from #18. This will apply cleanly with drush make (against the current views 7.x-3.x dev as well, which is also affected by this issue.)

Worth noting: While this does allow pagers to work again, it seems there's still an issue with panel_content view displays. My interim solution for that is to allow setting the use page, items per page, and offset options in the pane config. Then setting these in the panel pane configuration when adding the view to a panel.

Thus far it seems to work pretty solidly.

myxelf’s picture

Status: Reviewed & tested by the community » Needs review

Changing status in the meanwhile

mwbyrd’s picture

Ok. How do I install the patch?

Thanks,

Mike

dawehner’s picture

Status: Needs review » Needs work

Better then breaking this for many users, let's revert to the previous state of the logic and find a proper way to fix the behaviour which chx had.

fonant’s picture

Phew, I though I was going mad when editing a view reverted the page to "show all items" every time! #23 fixed it for me :)

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.12 KB

After many tries with chx here is a solution for non-database views.

dawehner’s picture

After many tries with chx here is a solution for non-database views.

dawehner’s picture

Status: Needs review » Fixed

Okay after quite some improvements to the comments i commited it to 7.x-3.x and 6.x-3.x

Status: Fixed » Closed (fixed)

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

nicholas.alipaz’s picture

Status: Closed (fixed) » Needs work

This still seems to be an issue. Using today's version of dev I get the following issue with all views that were previously working in alpha:

  • Views now display all results rather than the number of results set in the view.
  • Altering the pager settings changes the settings to "All Items" without allowing to change to anything else.
  • This is definitely a confirmed issue in a "default" view that is stored in a file.
Encarte’s picture

I've updated a test site from Views 6.x-2.x-dev to 6.x-3.0 and I can confirm this problems:

a) All the block displays with «Use pager: No» were changed to «Paged, 10 items». Other block displays weren't affected.

b) All the «Panel pane» displays with «Use pager: No» were changed to «Paged, 10 items». Unfortunately, all the panel panes in this site that weren't with «Use pager: No» were with 10 items and pager, so, I would have to set a new test site to see what would happen to other settings. But, we can assume they would probably be ok, like in a).

c) All the «Panel pane» displays are showing all the nodes, despite being setted to «Paged, 10 items». Some have the «Allow settings: None» option on the «Pane settings», and some have «Allow settings: Some» (with pager settings on the panel that are being ignored). This is causing memory time outs in some views (e. g.: Fatal error: Maximum execution time of 60 seconds exceeded in /home/example/public_html/example/includes/theme.inc on line 668 )

None of this problems seems to happen on page displays.

nicholas.alipaz’s picture

Priority: Major » Critical

Marking critical as this would break some pages on people's sites (when max execution occurs) and it breaks the normal operation of the module.

dawehner’s picture

This is really a hard issue as you can't know whether a view got converted or not.

jparets’s picture

I had exactly the same problem with all my views and displays, both in 6.x-3.0 and 7.x-3.1.
This implies a big amount of rework in upgrading (I have more than 100 views)
I think the decision about conversion could be:
- When Use pager option in Views2 is set to No, the option in Views3 should be "Display all items"
- When Use pager option in Views2 is set to Yes, the option in Views3 should be customized.
Good work!

dawehner’s picture

The best way to get a good update is to export your views to code with a decent version of views2.
Believe it or not but this is a way better way to see from which version things come from.

The current logic can be found at views_plugin_display::init(94). We have already tryed hard to get a version which works for all cases(which it does obvious not).

drzraf’s picture

My 6.x-2.16 block pager settings aren't considered by Views 3.x.

dawehner the problem does not appear to be in the conditional itself, (because !empty($items_per_page) && $items_per_page != 10 matches my case) then happens :

$this->set_option('items_per_page', NULL);
$this->set_option('pager', $pager);

where $pager =

array
  'type' => string 'some' (length=4)
  'options' => 
    array
      'offset' => int 0
      'items_per_page' => int 2

Unless the above structure is wrong, the issue probably happens later in the process.

drzraf’s picture

Here is the array as posted when using options_submit, case 'pager_options':

array
  'type' => string 'full' (length=4)
  'options' => 
    array
      'items_per_page' => string '2' (length=1)
      'offset' => string '0' (length=1)
      'id' => string '0' (length=1)
      'total_pages' => string '' (length=0)
      'expose' => 
        array
          'items_per_page' => int 0
          'items_per_page_label' => string 'Éléments par page' (length=19)
          'items_per_page_options' => string '5, 10, 20, 40, 60' (length=17)
          'items_per_page_options_all' => int 0
          'items_per_page_options_all_label' => string '- All -' (length=7)
          'offset' => int 0
          'offset_label' => string 'Décalage' (length=9)

so either the array in the previous comment is too incomplete, either the type (full or some affects the items_per_page setting)

drzraf’s picture

I tried to reproduce such a $pager array structure in init() but it didn't changed anything.
As my block settings are still greyed (marked non-overriden) it's somewhere around pager override settings that the fight should happen) :|

drzraf’s picture

Happens that adding $this->override_option('pager', TRUE); at the end of the block is a good start: field not greyed anymore.
I also found then that the default values (options_form case 'pager':) are still not those expected because at that time $pager = $this->get_option('pager'); only returns TRUE instead of the array, but I don't know why.

drzraf’s picture

I guess a call to views_get_plugin('pager', $pager["type"]) is missing somewhere in init() but don't know how and where ; Drupal code is far from being a pleasant abyss to dig into, ... maintainer ?

drzraf’s picture

I spent hours on this, again, without success.
Do you know guys that GPL forbids obfuscated code ! You overcame by far the limit between complexity and obfuscation. No one would ever takeover maintainer-ship without being paid for (and even so ...) !
There are probably nice contributors out there, but there's also many more hostages (/me being one of them)

merlinofchaos’s picture

Obfuscated? Um. Okay.

I'm sorry you're having trouble understanding it, but that's completely unnecessary. I recommend you take a step back and perhaps invest your energy into something else. Fix your views manually and move on.

This is a really hard problem to solve as evidence by the history of the issue. There is no need to be so rude about it.

This issue is the exact reason we have been afraid to make the 3.0 line recommended.

drzraf’s picture

right, no offense but unnecessary provocation. [ I'd benefit from a `have a drink` widget in the dashboard ]
I'll move on, as you advise, but FYI a common bug stack (actually not that huge) is the following :
* afaict no official language fallback mechanism in Drupal 6 which is (often) a must-have
thus:
* i18n patch : #634144: i18n views content negotiation + Mixed current language, depends on
* i18nviews, depends on
* views 3, depends on
* solving this bug

excuse my naivety (or presumption) about this issue, I didn't find another bug it would have to depend on and believed it was "self-contained".

good luck with it

merlinofchaos’s picture

Well, unless you have a LOT of views, fixing your pager settings is merely tedious but completely doable. Once your pager settings are fixed manually for all your views, you should have no issues.

Oh, one other way of solving this: I believe this only happens for views that are in the database. So you can work around htis by:

Use the bulk export module to export ALL your views to code.

Use drush to revert all your views to the code version.

Upgrade to Views 3.

Once in views 3, either re-export all your views or save your views and remove the export module. Your choice. I believe *that* preserves pager settings properly. (dawehner, can you please confirm or deny this for me?)

dawehner’s picture

Exactly the converting of the views works without problems if you have your views defined in code not in the database.

duaelfr’s picture

You two are right but #1557680: More link options not imported :)

Subliminal : please fix it.

yktdan’s picture

I just converted from most recent V2 to V3.0 and got hit with the pager bug. Fixing them after the conversion works, but it doesn't address the broken views in panel panes where the pager numbers are ignored and it displays all the rows. This seems more random, i.e. I don't see the pattern, some work and some don't.

The upgrade from V2 to D7 V3 also has the same problems and editing the views works and even if the bugs were fixed wouldn't fix all the views issues because many of the cck fields also got lost in the upgrade. We are still fighting our way through the 6->7 transition because of many conversion issues. Not enough time has been spent by developers on the upgrade path (yeah I know that is not sexy and I too would rather follow the bright shiny object that is the future).

ohthehugemanatee’s picture

@merlinofchaos

I believe this only happens for views that are in the database. So you can work around htis by:

Use the bulk export module to export ALL your views to code.

Use drush to revert all your views to the code version.

Upgrade to Views 3.

Once in views 3, either re-export all your views or save your views and remove the export module. Your choice. I believe *that* preserves pager settings properly.

Noting that this workaround no longer seems to work. I tried this procedure with Views Bulk Export and with Features, and had the pager problem in both. Here's the step-by-step I followed:

* Export all your views into bulk export or Features.
* Ensure Views considers them all "default". drush fr my_views_feature --force -y
* Upgrade Views. drush dl views-6.x-3.x-dev -y
-- Test the pager --
* try re-exporting your Views. drush fu my_views_feature -y
-- Test the pager --
* try just saving your views instead.
git checkout sites/all/modules/features/my_views_feature then edit/save each one manually.
-- Test the pager --

The pager settings were lost in all three tests. Is there a step I'm missing here? Is there a conversion tool like there was from Views 1 to 2? The views_update_60xx() hooks don't seem to have anything to do with this, so I didn't bother running the db update during this test.

aaronbauman’s picture

Issue summary: View changes
StatusFileSize
new3 KB

I applied this patch after updating from 6.x-2.x-dev to 6.x-3.x-dev
Builds on #28, but addresses a few missing pieces.

After updating to 6.x-3.x, successfully updated to un-patched 7.x-3.x and maintained pager settings.

Explanation in comments inline.

aaronbauman’s picture

Status: Needs work » Needs review
chris matthews’s picture

Status: Needs review » Closed (outdated)

The Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue

chris matthews’s picture

The Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue