I've got a view with a display that has a Date contextual filter. I want the default value of this filter to be a fixed string, so I set the "Provide default value" type to "Fixed value" and fill in the value with my string. This works fine, until I try to export the view using Features, then import that Feature into another site. The site with the imported feature has all the right settings in this view, except that the string for the actual fixed value is not defined.

Fortunately, I figured out what exported value was missing by looking through some other features, and discovered that it's default_argument_options that's missing. So by adding

  $handler->display->display_options['arguments']['field_is_pe_series_value']['default_argument_options']['argument'] = '0';

after this line:

  $handler->display->display_options['arguments']['field_is_pe_series_value']['default_argument_type'] = 'fixed';

I was able to fix my feature.

I'm honestly not sure, though, if this is a bug in Views, Features, ctools, or maybe even Date. But the really weird part is that after I manually added this line to my feature, and then edited my fixed value from the UI, Features didn't notice the difference, and continued to think that the view hadn't been overridden. So I went and saved a different change to my view, so that Features would recognize a difference, then reverted my feature. This caused both the reognized difference and the fixed value to get reverted to what's in my feature.


tgshannon’s picture

Comment removed

kmonty’s picture

Project: Views » Features
Version: 7.x-3.7 » 7.x-2.0
Issue summary: View changes

Verified bug.

hefox’s picture

Version: 7.x-2.0 » 7.x-2.x-dev

Huh, does export option via views ui export the view correctly?

coredumperror’s picture

Status: Active » Closed (works as designed)

Hmmm, I went back and checked, and it looks like this doesn't happen any more. Both the "Export view" functionality and the Feature itself recognize when I add a fixed argument value. I assume that this is due to a bugfix on the Views side, since I haven't updated Features since posting this issue, but I have updated Views several times.

Thanks for reminding me of this. My testing actually led to me realizing that a little-used view on my site was missing one of its argument defaults, and I've now fixed that problem.