mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
expose fix field mapping bc break (#4517)
This commit is contained in:
@@ -960,6 +960,9 @@ class PSExposeController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$exposeMappingName = $this->getExposeMappingName('field');
|
$exposeMappingName = $this->getExposeMappingName('field');
|
||||||
|
$fields = [];
|
||||||
|
$fieldMapping = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$clientAnnotationProfile = $this->getClientAnnotationProfile($exposeClient, $exposeName, $profile);
|
$clientAnnotationProfile = $this->getClientAnnotationProfile($exposeClient, $exposeName, $profile);
|
||||||
|
|
||||||
@@ -1216,12 +1219,23 @@ class PSExposeController extends Controller
|
|||||||
$fieldFromProfile = [];
|
$fieldFromProfile = [];
|
||||||
foreach ($actualFieldsList as $key => $value) {
|
foreach ($actualFieldsList as $key => $value) {
|
||||||
$t = explode('_', $key);
|
$t = explode('_', $key);
|
||||||
|
|
||||||
|
$oldFieldMapping = false;
|
||||||
|
if (count($t) == 2) {
|
||||||
|
$id = $key;
|
||||||
|
} else {
|
||||||
|
$oldFieldMapping = true;
|
||||||
|
$t = explode('_', $value);
|
||||||
|
$id = $value;
|
||||||
|
}
|
||||||
|
|
||||||
$databox = $this->getApplicationBox()->get_databox($t[0]);
|
$databox = $this->getApplicationBox()->get_databox($t[0]);
|
||||||
$viewName = $t[0]. ':::' .$databox->get_viewname();
|
$viewName = $t[0]. ':::' .$databox->get_viewname();
|
||||||
|
$name = $databox->get_meta_structure()->get_element($t[1])->get_label($this->app['locale']);
|
||||||
|
|
||||||
$fieldFromProfile[$viewName][$t[1]]['id'] = $key;
|
$fieldFromProfile[$viewName][$t[1]]['id'] = $id;
|
||||||
$fieldFromProfile[$viewName][$t[1]]['name'] = $databox->get_meta_structure()->get_element($t[1])->get_label($this->app['locale']);
|
$fieldFromProfile[$viewName][$t[1]]['name'] = $name;
|
||||||
$fieldFromProfile[$viewName][$t[1]]['exposeSideName'] = $value;
|
$fieldFromProfile[$viewName][$t[1]]['exposeSideName'] = ($oldFieldMapping) ? $name : $value;
|
||||||
$fieldFromProfile[$viewName][$t[1]]['checked'] = true;
|
$fieldFromProfile[$viewName][$t[1]]['checked'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user