mirror of
https://github.com/flextype/flextype.git
synced 2025-08-07 13:46:42 +02:00
fix(directives): fix issue with 2x caching of markdown, shortcodes and textile
This commit is contained in:
@@ -23,6 +23,12 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save markdown cache state to restore it later
|
||||
$markdownCacheState = registry()->get('flextype.settings.parsers.markdown.cache');
|
||||
|
||||
// Set markdown cache to false
|
||||
registry()->set('flextype.settings.parsers.markdown.cache', false);
|
||||
|
||||
$field = entries()->registry()->get('methods.fetch.field');
|
||||
|
||||
if (is_string($field['value'])) {
|
||||
@@ -35,4 +41,7 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
|
||||
entries()->registry()->set('methods.fetch.field.key', $field['key']);
|
||||
entries()->registry()->set('methods.fetch.field.value', $field['value']);
|
||||
|
||||
// Restore markdown cache state
|
||||
registry()->set('flextype.settings.parsers.markdown.cache', $markdownCacheState);
|
||||
});
|
@@ -23,6 +23,12 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save shortcodes cache state to restore it later
|
||||
$shortcodesCacheState = registry()->get('flextype.settings.parsers.shortcodes.cache');
|
||||
|
||||
// Set shortcodes cache to false
|
||||
registry()->set('flextype.settings.parsers.shortcodes.cache', false);
|
||||
|
||||
$field = entries()->registry()->get('methods.fetch.field');
|
||||
|
||||
if (is_string($field['value'])) {
|
||||
@@ -35,4 +41,7 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
|
||||
entries()->registry()->set('methods.fetch.field.key', $field['key']);
|
||||
entries()->registry()->set('methods.fetch.field.value', $field['value']);
|
||||
|
||||
// Restore shortcodes cache state
|
||||
registry()->set('flextype.settings.parsers.shortcodes.cache', $shortcodesCacheState);
|
||||
});
|
@@ -23,6 +23,12 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save textile cache state to restore it later
|
||||
$textileCacheState = registry()->get('flextype.settings.parsers.textile.cache');
|
||||
|
||||
// Set textile cache to false
|
||||
registry()->set('flextype.settings.parsers.textile.cache', false);
|
||||
|
||||
$field = entries()->registry()->get('methods.fetch.field');
|
||||
|
||||
if (is_string($field['value'])) {
|
||||
@@ -35,4 +41,7 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
|
||||
entries()->registry()->set('methods.fetch.field.key', $field['key']);
|
||||
entries()->registry()->set('methods.fetch.field.value', $field['value']);
|
||||
|
||||
// Restore textile cache state
|
||||
registry()->set('flextype.settings.parsers.textile.cache', $textileCacheState);
|
||||
});
|
Reference in New Issue
Block a user