/** * {@inheritDoc} */ public function getTranslatedDataFor($arrIds, $strLangCode) { $arrReturn = parent::getTranslatedDataFor($arrIds, $strLangCode); // Per definition: // - all values that are not contained are defaulting to false in the fallback language. // - all values in published not contained are defaulting to false. if ($this->isFixingOfValuesNeeded($arrReturn, $arrIds, $strLangCode)) { // We have to lock the retrieval to prevent endless recursion. $this->doNotFixValues = true; $fixedValues = array(); foreach (array_diff($arrIds, array_keys($arrReturn)) as $itemId) { $arrReturn[$itemId] = $this->widgetToValue(false, $itemId); $fixedValues[$itemId] = $arrReturn[$itemId]; } if (count($fixedValues)) { $this->setTranslatedDataFor($fixedValues, $strLangCode); } // Unlock the retrieval again as we have fixed the values in the database. $this->doNotFixValues = false; } return $arrReturn; }
/** * {@inheritDoc} */ public function getTranslatedDataFor($arrIds, $strLangCode) { $arrValues = parent::getTranslatedDataFor($arrIds, $strLangCode); foreach ($arrValues as $intId => $arrValue) { $arrValues[$intId]['value'] = ToolboxFile::convertUuidsOrPathsToMetaModels(deserialize($arrValue['value'], true)); } return $arrValues; }