@@ -1002,35 +1002,36 @@ private function _updateAttributeAdditionalData($entityTypeId, $id, $field, $val
1002
1002
return $ this ;
1003
1003
}
1004
1004
$ additionalTableExists = $ this ->setup ->getConnection ()->isTableExists ($ this ->setup ->getTable ($ additionalTable ));
1005
- if ($ additionalTable && $ additionalTableExists ) {
1006
- $ attributeFields = $ this ->setup ->getConnection ()->describeTable ($ this ->setup ->getTable ($ additionalTable ));
1007
- if (is_array ($ field )) {
1008
- $ bind = [];
1009
- foreach ($ field as $ k => $ v ) {
1010
- if (isset ($ attributeFields [$ k ])) {
1011
- $ bind [$ k ] = $ this ->setup ->getConnection ()->prepareColumnValue ($ attributeFields [$ k ], $ v );
1012
- }
1013
- }
1014
- if (!$ bind ) {
1015
- return $ this ;
1016
- }
1017
- $ field = $ bind ;
1018
- } else {
1019
- if (!isset ($ attributeFields [$ field ])) {
1020
- return $ this ;
1005
+ if (!$ additionalTableExists ) {
1006
+ return $ this ;
1007
+ }
1008
+ $ attributeFields = $ this ->setup ->getConnection ()->describeTable ($ this ->setup ->getTable ($ additionalTable ));
1009
+ if (is_array ($ field )) {
1010
+ $ bind = [];
1011
+ foreach ($ field as $ k => $ v ) {
1012
+ if (isset ($ attributeFields [$ k ])) {
1013
+ $ bind [$ k ] = $ this ->setup ->getConnection ()->prepareColumnValue ($ attributeFields [$ k ], $ v );
1021
1014
}
1022
1015
}
1023
- $ this ->setup ->updateTableRow (
1024
- $ this ->setup ->getTable ($ additionalTable ),
1025
- 'attribute_id ' ,
1026
- $ this ->getAttributeId ($ entityTypeId , $ id ),
1027
- $ field ,
1028
- $ value
1029
- );
1030
-
1031
- $ attribute = $ this ->getAttribute ($ entityTypeId , $ id );
1032
- $ this ->updateCachedRow ($ field , $ value , $ attribute );
1016
+ if (!$ bind ) {
1017
+ return $ this ;
1018
+ }
1019
+ $ field = $ bind ;
1020
+ } else {
1021
+ if (!isset ($ attributeFields [$ field ])) {
1022
+ return $ this ;
1023
+ }
1033
1024
}
1025
+ $ this ->setup ->updateTableRow (
1026
+ $ this ->setup ->getTable ($ additionalTable ),
1027
+ 'attribute_id ' ,
1028
+ $ this ->getAttributeId ($ entityTypeId , $ id ),
1029
+ $ field ,
1030
+ $ value
1031
+ );
1032
+
1033
+ $ attribute = $ this ->getAttribute ($ entityTypeId , $ id );
1034
+ $ this ->updateCachedRow ($ field , $ value , $ attribute );
1034
1035
1035
1036
return $ this ;
1036
1037
}
0 commit comments