Skip to content
Snippets Groups Projects
Commit 8cf3fbf0 authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-5032: fixing tags showing when there are none for catalogs

parent 0b978d3a
No related branches found
No related tags found
1 merge request!149Feature/istwcms 5032 ebremner catalogs
...@@ -417,7 +417,11 @@ class UWService implements UWServiceInterface { ...@@ -417,7 +417,11 @@ class UWService implements UWServiceInterface {
if (!empty($tabs)) { if (!empty($tabs)) {
foreach ($data as $key => $field) { foreach ($data as $key => $field) {
if (in_array($key, $tabs)) { if (in_array($key, $tabs)) {
$tags[$key] = $this->uwGetTermsFromEntityField($node->$field, 'tags'); $tags_to_add = $this->uwGetTermsFromEntityField($node->$field, 'tags');
if (!empty($tags_to_add)) {
$tags[$key] = $this->uwGetTermsFromEntityField($node->$field, 'tags');
}
} }
} }
} }
...@@ -428,6 +432,7 @@ class UWService implements UWServiceInterface { ...@@ -428,6 +432,7 @@ class UWService implements UWServiceInterface {
case 'tags': case 'tags':
$tags = []; $tags = [];
foreach ($data as $field) { foreach ($data as $field) {
$tags_to_add = $this->uwGetTermsFromEntityField($node->$field, 'tags');
$tags = array_merge($tags, $this->uwGetTermsFromEntityField($node->$field, 'tags')); $tags = array_merge($tags, $this->uwGetTermsFromEntityField($node->$field, 'tags'));
} }
$node_data[$index] = [$tags]; $node_data[$index] = [$tags];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment