mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
PHRAS-3584
fix api/v1/.../setcover ("Sub definition substituer locator was not set") original ticket #PHRAS-3592
This commit is contained in:
@@ -30,6 +30,7 @@ use Alchemy\Phrasea\Cache\Cache;
|
|||||||
use Alchemy\Phrasea\Collection\Reference\CollectionReference;
|
use Alchemy\Phrasea\Collection\Reference\CollectionReference;
|
||||||
use Alchemy\Phrasea\Controller\Controller;
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Core\Event\RecordEdit;
|
use Alchemy\Phrasea\Core\Event\RecordEdit;
|
||||||
|
use Alchemy\Phrasea\Core\LazyLocator;
|
||||||
use Alchemy\Phrasea\Core\PhraseaEvents;
|
use Alchemy\Phrasea\Core\PhraseaEvents;
|
||||||
use Alchemy\Phrasea\Core\Version;
|
use Alchemy\Phrasea\Core\Version;
|
||||||
use Alchemy\Phrasea\Databox\DataboxGroupable;
|
use Alchemy\Phrasea\Databox\DataboxGroupable;
|
||||||
@@ -2726,6 +2727,9 @@ class V1Controller extends Controller
|
|||||||
|
|
||||||
$ret = false;
|
$ret = false;
|
||||||
try {
|
try {
|
||||||
|
$story->setSubDefinitionSubstituerLocator(new LazyLocator($this->app, 'subdef.substituer'));
|
||||||
|
$story->setDataboxLoggerLocator($this->app['phraseanet.logger']);
|
||||||
|
|
||||||
$ret = $story->setStoryCover($fromChildRecordId, $coverSources);
|
$ret = $story->setStoryCover($fromChildRecordId, $coverSources);
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {
|
catch (\Exception $e) {
|
||||||
|
@@ -1052,7 +1052,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
|
|
||||||
foreach ($mandatoryParams as $k) {
|
foreach ($mandatoryParams as $k) {
|
||||||
if (!array_key_exists($k, $params)) {
|
if (!array_key_exists($k, $params)) {
|
||||||
throw new Exception_InvalidArgument(sprintf('Invalid metadata, missing key %s', $param));
|
throw new Exception_InvalidArgument(sprintf('Invalid metadata, missing key %s', $k));
|
||||||
}
|
}
|
||||||
$params[$k] = trim($params[$k]);
|
$params[$k] = trim($params[$k]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user