Projet

Général

Profil

Révision 99781f3b

Ajouté par Assos Assos il y a plus de 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views_pdf/views_pdf.install
60 60
}
61 61

  
62 62
/**
63
 * Update all PDF displays to use pager.
64
 * This should maintain existing pager settings.
65
 * Test your views before using in production.
63
 * The previous update to version 7.x-1.6 contained a faulty views_pdf_update_7000() function that
64
 * created a faulty views display object for some pdf displays (i.e. pdf display with the default "Display a specified number of items | 10"  pager )
65
 * This resulted in a display_option['pager'] NULL array element, which broke the pdf display.
66
 *
67
 * This new update replaces the views_pdf_update_7000() function and fixes the faulty array element
68
 * It is recommended that users avoid 7.x-1.6 and update to 7.x-1.7 version
66 69
 */
67
function views_pdf_update_7000() {
70
function views_pdf_update_7101() {
68 71
  $views = views_get_all_views();
69 72

  
70 73
  foreach ($views as $key => $view) {
71
    foreach ($view->display as $key => &$display) {
74
    foreach ($view->display as $key => $display) {
72 75
      if($display->display_plugin == 'pdf') {
73
        if(empty($display->display_options['defaults']['pager'])) {
74
          $display->display_options['pager'] = $view->display[$display->id]->display_options['pager'];
75
          $display->display_options['defaults']['pager'] = FALSE;
76
        if(isset($display->display_options['pager'])) {
77
          if (!isset($display->display_options['defaults']['pager']))  {
78
            $display->display_options['defaults']['pager'] = FALSE;
79
          }
80
          if (!isset($display->display_options['defaults']['pager_options'])) {
81
            $display->display_options['defaults']['pager_options'] = FALSE;
82
          }
76 83
        }
77 84
      }
78 85
    }

Formats disponibles : Unified diff