Skip to content

Commit c1f9f20

Browse files
committed
Ignore null Store ID in isVisibleOnStore function
1 parent 7b42b1c commit c1f9f20

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Model/Category.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ public function getMetaDescription()
395395
*/
396396
public function isVisibleOnStore($storeId)
397397
{
398-
return $this->getIsActive() && array_intersect([0, $storeId], $this->getStoreIds());
398+
return $this->getIsActive()
399+
&& (null === $storeId || array_intersect([0, $storeId], $this->getStoreIds()));
399400
}
400401

401402
/**

Model/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ public function isVisibleOnStore($storeId)
801801
{
802802
return $this->getIsActive()
803803
&& $this->getData('publish_time') <= $this->getResource()->getDate()->gmtDate()
804-
&& array_intersect([0, $storeId], $this->getStoreIds());
804+
&& (null === $storeId || array_intersect([0, $storeId], $this->getStoreIds()));
805805
}
806806

807807
/**

0 commit comments

Comments
 (0)