We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When saving in the backend, https://github.com/EmicoEcommerce/Magento2AttributeLanding/blob/master/src/Model/LandingPage.php#L165 doesn't get called, but https://github.com/EmicoEcommerce/Magento2AttributeLanding/blob/master/src/Controller/Adminhtml/Page/Save.php#L136 setData via a call from $this->dataObjectHelper->populateWithArray($landingPage, $data, LandingPageInterface::class);
setData needs to be overwritten to catch the url key being changed and then the trim applied.
See vendor/magento/framework/Api/DataObjectHelper.php:125
if ($dataObject instanceof \Magento\Framework\Model\AbstractModel) { $simpleData = array_filter($data, static function ($e) { return is_scalar($e) || is_null($e); }); if (isset($simpleData['id'])) { $dataObject->setId($simpleData['id']); unset($simpleData['id']); } $simpleData = array_intersect_key($simpleData, $setMethods); $dataObject->addData($simpleData); $data = array_diff_key($data, $simpleData); if (\count($data) === 0) { return $this; } }
See vendor/magento/framework/DataObject.php:53
/** * Add data to the object. * * Retains previous data in the object. * * @param array $arr * @return $this */ public function addData(array $arr) { if ($this->_data === []) { $this->setData($arr); return $this; } foreach ($arr as $index => $value) { $this->setData($index, $value); } return $this; } ```
The text was updated successfully, but these errors were encountered:
ah-net
No branches or pull requests
When saving in the backend, https://github.com/EmicoEcommerce/Magento2AttributeLanding/blob/master/src/Model/LandingPage.php#L165 doesn't get called, but
https://github.com/EmicoEcommerce/Magento2AttributeLanding/blob/master/src/Controller/Adminhtml/Page/Save.php#L136
setData via a call from $this->dataObjectHelper->populateWithArray($landingPage, $data, LandingPageInterface::class);
setData needs to be overwritten to catch the url key being changed and then the trim applied.
See vendor/magento/framework/Api/DataObjectHelper.php:125
See vendor/magento/framework/DataObject.php:53
The text was updated successfully, but these errors were encountered: