From 987f73ad365cbfae2a55b4cd5fdd9496dc5dc26d Mon Sep 17 00:00:00 2001
From: Daniel Wehner <daniel.wehner@erdfisch.de>
Date: Mon, 6 Aug 2012 15:37:08 +0200
Subject: [PATCH] Issue #1557680 by tim.plunkett, dawehner, DuaelFr: Fixed More
 link options not imported.

---
 lib/Drupal/views/ViewsObject.php | 12 ++++++++++++
 plugins/views_plugin_display.inc |  5 ++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lib/Drupal/views/ViewsObject.php b/lib/Drupal/views/ViewsObject.php
index 6de8408d44f9..141ec14dbfc5 100644
--- a/lib/Drupal/views/ViewsObject.php
+++ b/lib/Drupal/views/ViewsObject.php
@@ -51,6 +51,7 @@ class ViewsObject {
    *   Returns the options of this handler/plugin.
    *
    * @see Drupal\views\ViewsObject::export_option()
+   * @see Drupal\views\ViewsObject::export_option_always()
    * @see Drupal\views\ViewsObject::unpack_translatable()
    */
   function option_definition() { return array(); }
@@ -260,6 +261,17 @@ function export_option($indent, $prefix, $storage, $option, $definition, $parent
     return $output;
   }
 
+  /**
+   * Always exports the option, regardless of the default value.
+   */
+  function export_option_always($indent, $prefix, $storage, $option, $definition, $parents) {
+    // If there is no default, the option will always be exported.
+    unset($definition['default']);
+    // Unset our export method to prevent recursion.
+    unset($definition['export']);
+    return $this->export_option($indent, $prefix, $storage, $option, $definition, $parents);
+  }
+
   /**
    * Unpacks each handler to store translatable texts.
    */
diff --git a/plugins/views_plugin_display.inc b/plugins/views_plugin_display.inc
index 431277825ad5..ebcbcbe244bc 100644
--- a/plugins/views_plugin_display.inc
+++ b/plugins/views_plugin_display.inc
@@ -424,6 +424,8 @@ function defaultable_sections($section = NULL) {
       'group_by' => array('group_by'),
       'query' => array('query'),
       'use_more' => array('use_more', 'use_more_always', 'use_more_text'),
+      'use_more_always' => array('use_more', 'use_more_always', 'use_more_text'),
+      'use_more_text' => array('use_more', 'use_more_always', 'use_more_text'),
       'link_display' => array('link_display', 'link_url'),
 
       // Force these to cascade properly.
@@ -562,7 +564,8 @@ function option_definition() {
       ),
       'use_more_always' => array(
         'default' => FALSE,
-        'bool' => FALSE,
+        'bool' => TRUE,
+        'export' => 'export_option_always',
       ),
       'use_more_text' => array(
         'default' => 'more',
-- 
GitLab