File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Catalog/Model/Product/Attribute/Backend
Eav/Model/Entity/Attribute Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ public function beforeSave($object)
2525 $ attributeCode = $ this ->getAttribute ()->getName ();
2626 if ($ object ->getData ('use_config_ ' . $ attributeCode )) {
2727 $ object ->setData ($ attributeCode , BooleanSource::VALUE_USE_CONFIG );
28+ return $ this ;
2829 }
29- return $ this ;
30+
31+ return parent ::beforeSave ($ object );
3032 }
3133}
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ public function getIsVisibleOnFront()
383383 }
384384
385385 /**
386- * @return string|int|bool|float
386+ * @return string|null
387387 * @codeCoverageIgnore
388388 */
389389 public function getDefaultValue ()
Original file line number Diff line number Diff line change @@ -203,12 +203,12 @@ public function getEntityValueId($entity)
203203 /**
204204 * Retrieve default value
205205 *
206- * @return mixed
206+ * @return string
207207 */
208208 public function getDefaultValue ()
209209 {
210210 if ($ this ->_defaultValue === null ) {
211- if ($ this ->getAttribute ()->getDefaultValue ()) {
211+ if ($ this ->getAttribute ()->getDefaultValue () !== null ) {
212212 $ this ->_defaultValue = $ this ->getAttribute ()->getDefaultValue ();
213213 } else {
214214 $ this ->_defaultValue = "" ;
@@ -280,7 +280,7 @@ public function afterLoad($object)
280280 public function beforeSave ($ object )
281281 {
282282 $ attrCode = $ this ->getAttribute ()->getAttributeCode ();
283- if (!$ object ->hasData ($ attrCode ) && $ this ->getDefaultValue ()) {
283+ if (!$ object ->hasData ($ attrCode ) && $ this ->getDefaultValue () !== '' ) {
284284 $ object ->setData ($ attrCode , $ this ->getDefaultValue ());
285285 }
286286
You can’t perform that action at this time.
0 commit comments