Changes on SubdefGroup reflected in using clients

This commit is contained in:
Benoît Burnichon
2016-02-24 13:54:35 +01:00
parent 2b097e9be7
commit ca6c3f9920
3 changed files with 6 additions and 7 deletions

View File

@@ -44,11 +44,9 @@ class DatafileController extends AbstractDelivery
if ($subdef != 'thumbnail') {
$all_access = false;
$subdefStruct = $databox->get_subdef_structure();
if ($subdefStruct->getSubdefGroup($record->get_type())) {
foreach ($subdefStruct->getSubdefGroup($record->get_type()) as $subdefObj) {
/** @var \databox_subdef $subdefObj */
$subdefGroup = $databox->get_subdef_structure()->getSubdefGroup($record->getType());
if ($subdefGroup) {
foreach ($subdefGroup as $subdefObj) {
if ($subdefObj->get_name() == $subdef) {
if ($subdefObj->get_class() == 'thumbnail') {
$all_access = true;
@@ -75,7 +73,7 @@ class DatafileController extends AbstractDelivery
try {
$subdef_class = $databox
->get_subdef_structure()
->get_subdef($record->get_type(), $subdef)
->get_subdef($record->getType(), $subdef)
->get_class();
} catch (\Exception_Databox_SubdefNotFound $e) {

View File

@@ -73,7 +73,7 @@ class ToolsController extends Controller
continue;
}
$label = $databoxSubdefs[$subdefName]->get_label($this->app['locale']);
$label = $databoxSubdefs->getSubdef($subdefName)->get_label($this->app['locale']);
}
$recordAccessibleSubdefs[] = array(
'name' => $subdef->get_name(),

View File

@@ -50,6 +50,7 @@ class SubdefGenerator
{
if (null === $subdefs = $record->getDatabox()->get_subdef_structure()->getSubdefGroup($record->getType())) {
$this->logger->info(sprintf('Nothing to do for %s', $record->getType()));
$subdefs = [];
}
$this->dispatch(