File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,18 @@ protected static function parseCacheId(string $key): array
148
148
149
149
$ parts = explode ('. ' , $ key );
150
150
$ contentType = array_pop ($ parts );
151
- $ language = $ kirby ->multilang () === true ? array_pop ($ parts ) : null ;
152
- $ id = implode ('. ' , $ parts );
153
151
154
- return compact ('id ' , 'language ' , 'contentType ' );
152
+ // Check for the new Version API in Kirby 5
153
+ // Split a cache ID into `$id.$language.$version.$contentType`
154
+ if (class_exists ('Kirby\Content\Version ' ) === true ) {
155
+ $ version = array_pop ($ parts );
156
+ } else {
157
+ $ version = null ;
158
+ }
159
+
160
+ $ language = $ kirby ->multilang () === true ? array_pop ($ parts ) : null ;
161
+ $ id = implode ('. ' , $ parts );
162
+
163
+ return compact ('id ' , 'language ' , 'contentType ' , 'version ' );
155
164
}
156
165
}
You can’t perform that action at this time.
0 commit comments