Commit 52b8d16b authored by Henning Leutz's avatar Henning Leutz 🥋

Merge branch 'dev'

parents 04b2f7d0 95eb345c
......@@ -205,13 +205,19 @@ class Manager
*/
public function existsUniqueBrickId($uid)
{
$result = QUI::getDataBase()->fetch([
'from' => $this->getUIDTable(),
'where' => [
'uid' => $uid
],
'limit' => 1
]);
try {
$result = QUI::getDataBase()->fetch([
'from' => $this->getUIDTable(),
'where' => [
'uid' => $uid
],
'limit' => 1
]);
} catch (QUI\DataBase\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
return false;
}
return isset($result[0]);
}
......@@ -787,22 +793,28 @@ class Manager
*/
public function getSitesByBrick(Brick $Brick)
{
$result = [];
try {
$list = QUI::getDataBase()->fetch([
'select' => ['brickId', 'project', 'lang', 'siteId'],
'from' => $this->getUIDTable(),
'where' => [
'project' => $Brick->getAttribute('project'),
'lang' => $Brick->getAttribute('lang'),
'brickId' => $Brick->getAttribute('id')
]
]);
$list = QUI::getDataBase()->fetch([
'select' => ['brickId', 'project', 'lang', 'siteId'],
'from' => $this->getUIDTable(),
'where' => [
'project' => $Brick->getAttribute('project'),
'lang' => $Brick->getAttribute('lang'),
'brickId' => $Brick->getAttribute('id')
]
]);
$Project = QUI::getProject(
$Brick->getAttribute('project'),
$Brick->getAttribute('lang')
);
} catch (QUI\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
$Project = QUI::getProject(
$Brick->getAttribute('project'),
$Brick->getAttribute('lang')
);
return [];
}
$result = [];
foreach ($list as $entry) {
try {
......@@ -1121,13 +1133,18 @@ class Manager
);
foreach ($parentIds as $parentId) {
$bricks = QUI::getDataBase()->fetch([
'from' => $projectCacheTable,
'where' => [
'id' => $parentId,
'area' => $brickArea
]
]);
try {
$bricks = QUI::getDataBase()->fetch([
'from' => $projectCacheTable,
'where' => [
'id' => $parentId,
'area' => $brickArea
]
]);
} catch (QUI\DataBase\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
continue;
}
if (empty($bricks) || !\is_array($bricks)) {
continue;
......
......@@ -24,9 +24,15 @@ class Panel extends QUI\Utils\Singleton
*/
public function getCategoryFromBrick($brickId, $category)
{
$BrickManager = QUI\Bricks\Manager::init();
$Brick = $BrickManager->getBrickById($brickId);
$type = $Brick->getAttribute('type');
try {
$BrickManager = QUI\Bricks\Manager::init();
$Brick = $BrickManager->getBrickById($brickId);
$type = $Brick->getAttribute('type');
} catch (QUI\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
return '';
}
$cacheName = 'quiqqer/bricks/categories/category/'.$type.'/'.$category;
......@@ -35,7 +41,6 @@ class Panel extends QUI\Utils\Singleton
} catch (QUI\Exception $Exception) {
}
$files = Utils::getBricksXMLFiles();
$path = $this->getPath($Brick);
$path = $path.'/window';
......@@ -61,8 +66,14 @@ class Panel extends QUI\Utils\Singleton
*/
public function getCategoriesFromBrick($brickId)
{
$BrickManager = QUI\Bricks\Manager::init();
$Brick = $BrickManager->getBrickById($brickId);
try {
$BrickManager = QUI\Bricks\Manager::init();
$Brick = $BrickManager->getBrickById($brickId);
} catch (QUI\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
return [];
}
$xmlFiles = $this->getXMLFilesForBricks($Brick);
$path = $this->getPath($Brick);
......
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