From 8dafcf438ae5159e719a27a6db8dd7e04b0c7b8e Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Tue, 23 Apr 2024 23:41:57 +0200 Subject: [PATCH] Remove unused attributes from config_load fixes #993 --- .../language-function-config-load.md | 1 - src/Compile/Tag/ConfigLoad.php | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/designers/language-builtin-functions/language-function-config-load.md b/docs/designers/language-builtin-functions/language-function-config-load.md index e13c3083..1972179d 100644 --- a/docs/designers/language-builtin-functions/language-function-config-load.md +++ b/docs/designers/language-builtin-functions/language-function-config-load.md @@ -9,7 +9,6 @@ |----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | file | Yes | The name of the config file to include | | section | No | The name of the section to load | -| scope | no | How the scope of the loaded variables are treated, which must be one of local, parent or global. local means variables are loaded into the local template context. parent means variables are loaded into both the local context and the parent template that called it. global means variables are available to all templates. | ## Examples diff --git a/src/Compile/Tag/ConfigLoad.php b/src/Compile/Tag/ConfigLoad.php index d9e67ec9..8b4cf46d 100644 --- a/src/Compile/Tag/ConfigLoad.php +++ b/src/Compile/Tag/ConfigLoad.php @@ -43,7 +43,7 @@ class ConfigLoad extends Base { * @var array * @see BasePlugin */ - protected $optional_attributes = ['section', 'scope']; + protected $optional_attributes = ['section']; /** * Attribute definition: Overwrites base class. @@ -51,7 +51,7 @@ class ConfigLoad extends Base { * @var array * @see BasePlugin */ - protected $option_flags = ['nocache', 'noscope']; + protected $option_flags = []; /** * Compiles code for the {config_load} tag @@ -66,9 +66,7 @@ class ConfigLoad extends Base { { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', null, true); - } + // save possible attributes $conf_file = $_attr['file']; $section = $_attr['section'] ?? 'null';