File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 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)
114114 */
115115 protected function _afterSave (\Magento \Framework \Model \AbstractModel $ object )
116116 {
117- $ oldStoreIds = $ this ->lookupStoreIds ($ object ->getId ());
117+ $ oldStoreIds = $ this ->lookupStoreIds ($ object ->getId (), false );
118118 $ newStoreIds = (array )$ object ->getStoreIds ();
119119 if (!$ newStoreIds || in_array (0 , $ newStoreIds )) {
120120 $ newStoreIds = [0 ];
@@ -254,12 +254,13 @@ public function checkIdentifier($identifier, $storeIds)
254254 /**
255255 * Get store ids to which specified item is assigned
256256 *
257- * @param int $categoryId
258- * @return array
257+ * @param $categoryId
258+ * @param bool $useCache
259+ * @return array|mixed
259260 */
260- public function lookupStoreIds ($ categoryId )
261+ public function lookupStoreIds ($ categoryId, $ useCache = true )
261262 {
262- if (null === self ::$ allStoreIds ) {
263+ if (null === self ::$ allStoreIds || ! $ useCache ) {
263264 $ adapter = $ this ->getConnection ();
264265
265266 $ select = $ adapter ->select ()->from (
You can’t perform that action at this time.
0 commit comments