@@ -27,26 +27,26 @@ class Text extends \Magento\Eav\Model\Attribute\Data\AbstractData
2727 /**
2828 * @var array
2929 */
30- private $ encodeAttributesByTypesList ;
30+ private $ allowDiacriticsForAttributes ;
3131
3232 /**
3333 * @param TimezoneInterface $localeDate
3434 * @param LoggerInterface $logger
3535 * @param ResolverInterface $localeResolver
3636 * @param StringUtils $stringHelper
37- * @param array $encodeAttributesByTypesList
37+ * @param array $allowDiacriticsForAttributes
3838 * @codeCoverageIgnore
3939 */
4040 public function __construct (
4141 \Magento \Framework \Stdlib \DateTime \TimezoneInterface $ localeDate ,
4242 \Psr \Log \LoggerInterface $ logger ,
4343 \Magento \Framework \Locale \ResolverInterface $ localeResolver ,
4444 \Magento \Framework \Stdlib \StringUtils $ stringHelper ,
45- array $ encodeAttributesByTypesList = []
45+ array $ allowDiacriticsForAttributes = []
4646 ) {
4747 parent ::__construct ($ localeDate , $ logger , $ localeResolver );
4848 $ this ->_string = $ stringHelper ;
49- $ this ->encodeAttributesByTypesList = $ encodeAttributesByTypesList ;
49+ $ this ->allowDiacriticsForAttributes = $ allowDiacriticsForAttributes ;
5050 }
5151
5252 /**
@@ -91,7 +91,11 @@ public function validateValue($value)
9191 return $ errors ;
9292 }
9393
94- if (in_array ($ attribute ->getAttributeCode (), $ this ->encodeAttributesByTypesList [$ attribute ->getEntityType ()->getEntityTypeCode ()])) {
94+ if (isset ($ this ->allowDiacriticsForAttributes [$ this ->getAttribute ()->getEntityType ()->getEntityTypeCode ()])
95+ && in_array (
96+ $ this ->getAttribute ()->getAttributeCode (),
97+ $ this ->allowDiacriticsForAttributes [$ this ->getAttribute ()->getEntityType ()->getEntityTypeCode ()]
98+ )) {
9599 // if string with diacritics encode it.
96100 $ value = $ this ->encodeDiacritics ($ value );
97101 }
0 commit comments