mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
fix: setfield clause
This commit is contained in:
@@ -56,7 +56,7 @@ class RecordsActionsWorker implements WorkerInterface
|
||||
else {
|
||||
$sxSettings = simplexml_load_string($xmlSettings);
|
||||
if((string)$sxSettings['version'] !== "2") {
|
||||
throw new JsonValidationException(sprintf("bad settings version (%s), should be \"2\"", (string)$sxml['version']));
|
||||
throw new JsonValidationException(sprintf("bad settings version (%s), should be \"2\"", (string)$sxSettings['version']));
|
||||
}
|
||||
$em = $this->repoWorker->getEntityManager();
|
||||
$em->beginTransaction();
|
||||
@@ -256,7 +256,7 @@ class RecordsActionsWorker implements WorkerInterface
|
||||
$js
|
||||
));
|
||||
|
||||
if(!$row|'dry') {
|
||||
if(!$row['dry']) {
|
||||
$rec->setMetadatasByActions(json_decode($js, false)); // false: setMetadatasByActions expects object, not array !
|
||||
}
|
||||
}
|
||||
@@ -470,7 +470,7 @@ class RecordsActionsWorker implements WorkerInterface
|
||||
|
||||
// action <compute_date direction="dir"...>
|
||||
foreach ($sxThen->compute_date as $x) {
|
||||
$this->add_THEN_ComputeDateClause($sqlBuilder, $databox, strtoupper(trim($x['direction'])), trim($x['field']), strtoupper(trim($x['delta'])), trim($x['computed']));
|
||||
$this->add_THEN_ComputeDateClause($sqlBuilder, $databox, trim($x['field']), strtoupper(trim($x['delta'])), trim($x['computed']));
|
||||
}
|
||||
|
||||
// action <coll id="X" />
|
||||
@@ -776,7 +776,7 @@ class RecordsActionsWorker implements WorkerInterface
|
||||
}
|
||||
}
|
||||
|
||||
private function add_THEN_ComputeDateClause(SqlBuilder $sqlBuilder, databox $databox, string $dir, string $fieldName, string $delta, string $computedRefKey)
|
||||
private function add_THEN_ComputeDateClause(SqlBuilder $sqlBuilder, databox $databox, string $fieldName, string $delta, string $computedRefKey)
|
||||
{
|
||||
$this->checkComputedRefKey($computedRefKey);
|
||||
|
||||
@@ -804,15 +804,6 @@ class RecordsActionsWorker implements WorkerInterface
|
||||
}
|
||||
}
|
||||
|
||||
$dirop = "";
|
||||
if (in_array($dir, array('BEFORE', 'AFTER'))) {
|
||||
$dirop .= ($dir == 'BEFORE') ? '<' : '>=';
|
||||
}
|
||||
else {
|
||||
// bad direction
|
||||
throw new Exception(sprintf("bad direction (%s)\n", $dir));
|
||||
}
|
||||
|
||||
switch ($fieldName) {
|
||||
case '#moddate':
|
||||
case '#credate':
|
||||
|
Reference in New Issue
Block a user