cancel
Showing results for 
Search instead for 
Did you mean: 

php api product-image-name / product-image-label accepted encoding?

php api product-image-name / product-image-label accepted encoding?

Hi, 

I'm programmatically adding products via the PHP api. Both of the following are throwing product-save exceptions if i use anything other than alphanumeric/spaces. Wondering if these fields are restricted to alphanumeric/spaces or if it's a specific encoding i need to use.  Most other fields, i've found to require utf8_encode() but it is not working for:

 

'\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface'

->setLabel("this is a . problem string")
->setLabel("this is a not problem string") '\Magento\Framework\Api\Data\ImageContentInterface' ->setName("this is a . problem string")
->setName("this is a not problem string")

 

Can anyone point me to where it says what characters are allowed?

 

Also, interestingly enough, if i view catalog/products via backend for products that successfully saved, alt text for those images is empty. You'd think that's what Label would be used for, no? considering this is the comment about the php api member function setLabel.

/**
* Set gallery entry alternative text
*
* @param string $label
* @return $this
*/

Alt-Text not showing seems to be a bug that was partially fixed but that was for an older version. https://github.com/magento/magento2/issues/9931