Skip to content
Code-Schnipsel Gruppen Projekte
Commit 4f66bfea erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: namefruits/juicer#213

Übergeordneter 1dbc3894
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -10,8 +10,6 @@
use QUI\Projects\Project;
use QUI\Projects\Site;
use QUI\Utils\Text\XML;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
/**
* Brick Manager
......@@ -138,7 +136,7 @@ public function createBrickForProject(Project $Project, Brick $Brick)
*/
public function createUniqueSiteBrick(Site $Site, $brickData = array())
{
if (isset($brickData['uid'])) {
if (isset($brickData['uid']) || empty($brickData['uid'])) {
$uid = $brickData['uid'];
if ($this->existsUniqueBrickId($uid) === false) {
......@@ -178,28 +176,19 @@ public function createUniqueSiteBrick(Site $Site, $brickData = array())
protected function createUniqueBrickId($brickId, $Site)
{
$Project = $Site->getProject();
$uId = md5(microtime());
$uuid = QUI\Utils\Uuid::get();
$Brick = $this->getBrickById($brickId);
try {
$UUID = Uuid::uuid1();
$uId = $UUID->toString();
QUI::getDataBase()->insert($this->getUIDTable(), array(
'uid' => $uId,
'brickId' => $brickId,
'project' => $Project->getName(),
'lang' => $Project->getLang(),
'siteId' => $Site->getId(),
'attributes' => json_encode($Brick->getAttributes())
));
} catch (UnsatisfiedDependencyException $Exception) {
QUI\System\Log::writeException($Exception);
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
}
QUI::getDataBase()->insert($this->getUIDTable(), array(
'uid' => $uuid,
'brickId' => $brickId,
'project' => $Project->getName(),
'lang' => $Project->getLang(),
'siteId' => $Site->getId(),
'attributes' => json_encode($Brick->getAttributes())
));
return $uId;
return $uuid;
}
/**
......@@ -817,9 +806,6 @@ public function saveBrick($brickId, array $brickData)
}
}
QUI\System\Log::writeRecursive($brickData);
QUI\System\Log::writeRecursive($Brick->getSettings());
// update
QUI::getDataBase()->update($this->getTable(), array(
'title' => $Brick->getAttribute('title'),
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren