Viewfield allows to select disabled views, and also to configure disabled views in its allowed values.

Comments

sun’s picture

Status: Active » Fixed
StatusFileSize
new662 bytes

Committed attached patch.

sun’s picture

Status: Fixed » Needs work

Sorry, that was too fast and naive.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.39 KB

Attached patch fixes the remaining instances.

sun’s picture

StatusFileSize
new2.5 KB
+++ b/viewfield.module
@@ -233,14 +232,16 @@ function viewfield_field_widget_form(&$form, &$form_state, $field, $instance, $l
   // Limit to allowed values, if any.
-  if (!empty($field['settings']['allowed_views']) && is_array($field['settings']['allowed_views'])) {
-    $views = array_intersect_key($views, array_filter($field['settings']['allowed_views']));
+  if (isset($field['settings']['allowed_views']) && is_array($field['settings']['allowed_views'])) {
+    if ($allowed = array_filter($field['settings']['allowed_views'])) {
+      $views = array_intersect_key($views, $allowed);
+    }
   }

ok, that could use an inline comment.

keithm’s picture

Status: Needs review » Reviewed & tested by the community

This looks good.

sun’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reporting, reviewing, and testing! Committed to 7.x-2.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

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