Commit 8bac3989 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1795189: Handle collections better when making page via tags



behatnotneeded

Change-Id: Iac1d86acc61b8a7d06477f1cfffdb1bef2cbc3b1
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit cc724200)
parent 04a2d628
...@@ -789,6 +789,7 @@ function set_view_title_and_description(Pieform $form, $values) { ...@@ -789,6 +789,7 @@ function set_view_title_and_description(Pieform $form, $values) {
JOIN {view_layout_columns} vlc ON vlc.id = vlrc.columns JOIN {view_layout_columns} vlc ON vlc.id = vlrc.columns
WHERE vlrc.viewlayout = ? and vlrc.row = ?", array($values['currentlayoutselect'], 1)); WHERE vlrc.viewlayout = ? and vlrc.row = ?", array($values['currentlayoutselect'], 1));
require_once('searchlib.php'); require_once('searchlib.php');
require_once('collection.php');
$data = array(); $data = array();
// Get all the items containing any of the tags // Get all the items containing any of the tags
foreach ($createtags as $tag) { foreach ($createtags as $tag) {
...@@ -801,6 +802,10 @@ function set_view_title_and_description(Pieform $form, $values) { ...@@ -801,6 +802,10 @@ function set_view_title_and_description(Pieform $form, $values) {
$combineddata = array(); $combineddata = array();
// Now check what we have so we know what to do with them // Now check what we have so we know what to do with them
foreach ($data as $item) { foreach ($data as $item) {
// If collection but tag is in one of it's views then no $item->tags so skip
if (!isset($item->tags)) {
continue;
}
// Check that the block has all of the tags we entered, and if not skip it // Check that the block has all of the tags we entered, and if not skip it
if (array_diff($createtags, $item->tags)) { if (array_diff($createtags, $item->tags)) {
continue; continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment