There are several plugins that provide different ways to select a default argument:

modules/node/views_plugin_argument_default_node.inc
modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
modules/user/views_plugin_argument_default_current_user.inc
modules/user/views_plugin_argument_default_user.inc
plugins/views_plugin_argument_default.inc
plugins/views_plugin_argument_default_fixed.inc
plugins/views_plugin_argument_default_php.inc
plugins/views_plugin_argument_default_raw.inc

But views_handler_argument_date::default_argument_form() adds its 3 of its own default_argument_type after views_handler_argument::default_argument_form() calls views_fetch_plugin_data('argument default');.

Selecting any of those three ("Current date", "Current node's creation time", "Current node's update time") in the UI works fine, but none of them get exported.

Other than rewriting all of these into plugins, the other option is to adjust the export code to detect these non-plugin options.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
1.36 KB

This kind of handler is special/hacky so the export method has to be adapted.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Before: http://paste.pocoo.org/show/473275/
After: http://paste.pocoo.org/show/473645/

--- before	2011-09-10 11:47:58.000000000 -0400
+++ after	2011-09-10 11:48:23.000000000 -0400
@@ -57,6 +57,7 @@ $handler->display->display_options['argu
 $handler->display->display_options['arguments']['changed_year_month']['table'] = 'node';
 $handler->display->display_options['arguments']['changed_year_month']['field'] = 'changed_year_month';
 $handler->display->display_options['arguments']['changed_year_month']['default_action'] = 'default';
+$handler->display->display_options['arguments']['changed_year_month']['default_argument_type'] = 'date';
 $handler->display->display_options['arguments']['changed_year_month']['default_argument_skip_url'] = 0;
 $handler->display->display_options['arguments']['changed_year_month']['summary']['number_of_records'] = '0';
 $handler->display->display_options['arguments']['changed_year_month']['summary']['format'] = 'default_summary';

It also works on import correctly.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reviewing and testing the patch, and sure also for providing/finding the bug.

Commited to 7.x

andypost’s picture

Status: Fixed » Reviewed & tested by the community

Please remove dsm()

+      if (in_array($name, array('date', 'node_created', 'node_changed'))) {
+        dsm($name);
+
dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Commited to 7.x-3.x

Status: Fixed » Closed (fixed)

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

infojunkie’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Closed (fixed) » Needs review
FileSize
1.24 KB

Rerolled the patch for Views 6.x-3.x. Please commit there too.

dawehner’s picture

Status: Needs review » Fixed

Oh, actually i wanted to mark each patch as needs backport if it makes sense.

Thanks for rerolling the patch, committed to 6.x-3.x

Status: Fixed » Closed (fixed)

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