Could not bulk import with the "final class" (interactive import).

SVN:trunk[4348]
This commit is contained in:
Romain Quetiez
2016-08-24 16:50:02 +00:00
parent ef5d156b98
commit 3d57c720e0

View File

@@ -2116,6 +2116,41 @@ class AttributeFinalClass extends AttributeString
}
}
/**
* An enum can be localized
*/
public function MakeValueFromString($sProposedValue, $bLocalizedValue = false, $sSepItem = null, $sSepAttribute = null, $sSepValue = null, $sAttributeQualifier = null)
{
if ($bLocalizedValue)
{
// Lookup for the value matching the input
//
$sFoundValue = null;
$aRawValues = self::GetAllowedValues();
if (!is_null($aRawValues))
{
foreach ($aRawValues as $sKey => $sValue)
{
if ($sProposedValue == $sValue)
{
$sFoundValue = $sKey;
break;
}
}
}
if (is_null($sFoundValue))
{
return null;
}
return $this->MakeRealValue($sFoundValue, null);
}
else
{
return parent::MakeValueFromString($sProposedValue, $bLocalizedValue, $sSepItem, $sSepAttribute, $sSepValue, $sAttributeQualifier);
}
}
// Because this is sometimes used to get a localized/string version of an attribute...
public function GetEditValue($sValue, $oHostObj = null)
{