File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
114
114
*/
115
115
protected function _afterSave (\Magento \Framework \Model \AbstractModel $ object )
116
116
{
117
- $ oldStoreIds = $ this ->lookupStoreIds ($ object ->getId ());
117
+ $ oldStoreIds = $ this ->lookupStoreIds ($ object ->getId (), false );
118
118
$ newStoreIds = (array )$ object ->getStoreIds ();
119
119
if (!$ newStoreIds || in_array (0 , $ newStoreIds )) {
120
120
$ newStoreIds = [0 ];
@@ -254,12 +254,13 @@ public function checkIdentifier($identifier, $storeIds)
254
254
/**
255
255
* Get store ids to which specified item is assigned
256
256
*
257
- * @param int $categoryId
258
- * @return array
257
+ * @param $categoryId
258
+ * @param bool $useCache
259
+ * @return array|mixed
259
260
*/
260
- public function lookupStoreIds ($ categoryId )
261
+ public function lookupStoreIds ($ categoryId, $ useCache = true )
261
262
{
262
- if (null === self ::$ allStoreIds ) {
263
+ if (null === self ::$ allStoreIds || ! $ useCache ) {
263
264
$ adapter = $ this ->getConnection ();
264
265
265
266
$ select = $ adapter ->select ()->from (
You can’t perform that action at this time.
0 commit comments