Skip to content

Find out about $defaultDictionary #1541

@tvdijen

Description

@tvdijen
--- a/lib/SimpleSAML/Locale/Translate.php
+++ b/lib/SimpleSAML/Locale/Translate.php
@@ -37,13 +37,11 @@ class Translate
      * Constructor
      *
      * @param \SimpleSAML\Configuration $configuration Configuration object
-     * @param string|null $defaultDictionary The default dictionary where tags will come from.
      */
-    public function __construct(Configuration $configuration, ?string $defaultDictionary = null)
+    public function __construct(Configuration $configuration)
     {
         $this->configuration = $configuration;
         $this->language = new Language($configuration);
-        $this->defaultDictionary = $defaultDictionary;
     }


diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index e62062d14..6f95fd861 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -118,9 +118,8 @@ class Template extends Response
      *
      * @param \SimpleSAML\Configuration $configuration Configuration object
      * @param string                   $template Which template file to load
-     * @param string|null              $defaultDictionary The default dictionary where tags will come from.
      */
-    public function __construct(Configuration $configuration, string $template, string $defaultDictionary = null)
+    public function __construct(Configuration $configuration, string $template)
     {
         $this->configuration = $configuration;
         $this->template = $template;
@@ -136,7 +135,7 @@ class Template extends Response
         );

         // initialize internationalization system
-        $this->translator = new Translate($configuration, $defaultDictionary);
+        $this->translator = new Translate($configuration);

I had almost removed these two lines, because $defaultDictionary isn't used anywhere else, but found out that it's being used in many templates....

lib/SimpleSAML/Error/Error.php:            $t = new Template($config, 'error.twig', 'errors');
lib/SimpleSAML/XHTML/IdPDisco.php:        $t = new Template($this->config, $templateFile, 'disco');
modules/admin/lib/Controller/Test.php:            $t = new Template($this->config, 'admin:status.twig', 'attributes');
modules/core/lib/Controller/Login.php:        $t = new Template($this->config, 'auth_status.twig', 'attributes');
modules/cron/lib/Controller/Cron.php:        $t = new Template($this->config, 'cron:croninfo.twig', 'cron:cron');
modules/cron/lib/Controller/Cron.php:            $t = new Template($this->config, 'cron:croninfo-result.twig', 'cron:cron');
modules/saml/www/sp/metadata.php:    $t = new Template($config, 'metadata.twig', 'admin');
modules/adfs/lib/Controller/AdfsController.php:                $t = new Template($this->config, 'metadata.twig', 'admin');

Figure out if these former uses are still necessary / are broken / need fixing before removing the parameters from the methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions