From 0d3a33f1ba87653a47d0872f0c946f706e5f4fae Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 7 Aug 2019 00:14:22 +0200 Subject: [PATCH] Fix attribute visibility view if none selected (#2485) --- application/controllers/Attributes.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php index 0e8e0410c..ab2b82c95 100644 --- a/application/controllers/Attributes.php +++ b/application/controllers/Attributes.php @@ -131,7 +131,7 @@ class Attributes extends Secure_Controller $definition_flag_names = array(); foreach (Attribute::get_definition_flags() as $id => $term) { - if (empty($definition_flags) || ($id & $definition_flags)) + if ($id & $definition_flags) { $definition_flag_names[$id] = $this->lang->line('attributes_' . strtolower($term) . '_visibility'); } @@ -153,7 +153,8 @@ class Attributes extends Secure_Controller $data['definition_group'][''] = $this->lang->line('common_none_selected_text'); $data['definition_info'] = $info; - $data['definition_flags'] = $this->_get_attributes(); + $show_all = Attribute::SHOW_IN_ITEMS | Attribute::SHOW_IN_RECEIVINGS | Attribute::SHOW_IN_SALES; + $data['definition_flags'] = $this->_get_attributes($show_all); $data['selected_definition_flags'] = $this->_get_attributes($info->definition_flags); $this->load->view("attributes/form", $data);