This repository was archived by the owner on Jul 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 22
33namespace Aerni \DynamicCache ;
44
5- use Aerni \DynamicCache \Contracts \Data as DataContract ;
6- use Illuminate \Support \Collection ;
75use RecursiveArrayIterator ;
6+ use Statamic \Facades \Entry ;
87use RecursiveIteratorIterator ;
9- use Statamic \Entries \Entry ;
8+ use Illuminate \Support \Collection ;
9+ use Aerni \DynamicCache \Contracts \Data as DataContract ;
1010
1111class Data implements DataContract
1212{
@@ -43,6 +43,10 @@ public function getInvalidationRules(): Collection
4343 private function entriesToExcludeFromStaticCache (): Collection
4444 {
4545 return Entry::all ()->map (function ($ entry ) {
46+ if (empty ($ entry ->route ())) {
47+ return false ;
48+ }
49+
4650 if ($ this ->shouldExcludeEntryFromStaticCache ($ entry ->values ())) {
4751 return $ entry ;
4852 }
@@ -53,6 +57,10 @@ private function entriesToExcludeFromStaticCache(): Collection
5357 private function entriesToIncludeInInvalidationRules (): Collection
5458 {
5559 return Entry::all ()->map (function ($ entry ) {
60+ if (empty ($ entry ->route ())) {
61+ return false ;
62+ }
63+
5664 if (! $ this ->shouldExcludeEntryFromStaticCache ($ entry ->values ())) {
5765 return $ entry ;
5866 }
You can’t perform that action at this time.
0 commit comments