Actually all instances of options in option_definition should use 'bool' => TRUE for options which are boolean.

This might/is a problem for all users of features, suddenly all features will get changed, which can really cause problems for some people.

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new51.52 KB

Here is a first start, even I looked at all handlers/plugins.

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/handlers/views_handler_argument.incundefined
@@ -176,17 +176,17 @@ class views_handler_argument extends views_handler {
+        'title_enable' => array('default' => 0, 'bool' => TRUE),

Either switch the default to a bool, or leave off the bool flag.

+++ b/handlers/views_handler_argument.incundefined
@@ -176,17 +176,17 @@ class views_handler_argument extends views_handler {
+    $options['title_enable'] = array('default' => 0, 'bool' => TRUE);

.

+++ b/handlers/views_handler_argument.incundefined
@@ -176,17 +176,17 @@ class views_handler_argument extends views_handler {
+    $options['breadcrumb_enable'] = array('default' => 0, 'bool' => TRUE);

.

+++ b/handlers/views_handler_argument.incundefined
@@ -195,7 +195,7 @@ class views_handler_argument extends views_handler {
+    $options['specify_validation'] = array('default' => 0, 'bool' => TRUE);

.

+++ b/handlers/views_handler_field.incundefined
@@ -370,32 +370,32 @@ class views_handler_field extends views_handler {
+        'absolute' => array('default' => '', 'translatable' => FALSE, 'bool' => TRUE),
+        'external' => array('default' => '', 'translatable' => FALSE, 'bool' => TRUE),
+        'replace_spaces' => array('default' => '', 'translatable' => FALSE, 'bool' => TRUE),
+        'path_case' => array('default' => 'none', 'translatable' => FALSE, 'bool' => TRUE),

.

+++ b/handlers/views_handler_field_numeric.incundefined
@@ -13,10 +13,10 @@ class views_handler_field_numeric extends views_handler_field {
+    $options['precision'] = array('default' => 0, 'bool' => TRUE);

.

+++ b/handlers/views_handler_filter.incundefined
@@ -98,9 +98,9 @@ class views_handler_filter extends views_handler {
+        'required' => array('default' => 0, 'bool' => TRUE),
+        'remember' => array('default' => 0, 'bool' => TRUE),
+        'multiple' => array('default' => 0, 'bool' => TRUE),

.

+++ b/modules/comment/views_handler_field_comment_node_link.incundefined
@@ -22,7 +22,7 @@ class views_handler_field_comment_node_link extends views_handler_field_entity {
+    $options['teaser'] = array('default' => 0, 'bool' => TRUE);

.

+++ b/modules/node/views_handler_field_node.incundefined
@@ -26,7 +26,7 @@ class views_handler_field_node extends views_handler_field {
-    $options['link_to_node'] = array('default' => isset($this->definition['link_to_node default']) ? $this->definition['link_to_node default'] : FALSE);
+    $options['link_to_node'] = array('default' => isset($this->definition['link_to_node default']) ? $this->definition['link_to_node default'] : FALSE, 'bool' => TRUE);

This just looks wrong.

dawehner’s picture

Status: Needs work » Needs review

Okay let's convert the default values as well.

The last wrong is also a boolean, so what does this look wrong?

Just reread the patch twice, to be sure nothing was changed wrong.
git diff --color-words is quite helpful here.

dawehner’s picture

StatusFileSize
new51.31 KB

Okay this time with a patch :(

tim.plunkett’s picture

My comment about "link_to_node default" was just that we normally don't use conditionals for the defaults.

Whether or not something is default affects how it gets exported. If the selected option matches the default, it is left out of the export.

However, I just realized it's checking $this->definition, not $this->options or something, so maybe it's not too big of a deal?

tim.plunkett’s picture

My comment about "link_to_node default" was just that we normally don't use conditionals for the defaults.

Whether or not something is default affects how it gets exported. If the selected option matches the default, it is left out of the export.

However, I just realized it's checking $this->definition, not $this->options or something, so maybe it's not too big of a deal?

dawehner’s picture

However, I just realized it's checking $this->definition, not $this->options or something, so maybe it's not too big of a deal?

Yes, this is intended behavior.

For node: title you want to have the link enabled by default, though for node: nid you don't want it, though internally both use the same handler, so we need some kind of mechanism to control this.

tim.plunkett’s picture

StatusFileSize
new4.15 KB
new53.79 KB

Okay, found a couple more instances, I've attached an interdiff to show my additions.

If you're okay with those, I think this is ready to go.

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Thanks for the interdiff!
Your changes looks perfect, let's get it out!

chris matthews’s picture

Issue summary: View changes
Status: Patch (to be ported) » 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