]> git.agnieray.net Git - galette.git/commitdiff
Fix missing texts insertion; closes #1587
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 30 Oct 2021 10:22:43 +0000 (12:22 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 30 Oct 2021 10:22:43 +0000 (12:22 +0200)
galette/lib/Galette/Controllers/TextController.php
galette/lib/Galette/Entity/Texts.php

index d680b9554a49e683691a41ffdba5266f6ca07c49..9bb032c67c92c789ace3968853fe7d982df93c88 100644 (file)
@@ -91,7 +91,7 @@ class TextController extends AbstractController
             [
                 'page_title'        => _T("Automatic emails texts edition"),
                 'texts'             => $texts,
-                'reflist'           => $texts->getRefs($lang),
+                'reflist'           => $texts->getRefs(),
                 'langlist'          => $this->i18n->getList(),
                 'cur_lang'          => $lang,
                 'cur_ref'           => $ref,
index f2add2d8579a997232a41286c80a3ff23080a22a..8f59cfa21e430db99d438878fe93f7227b415f09 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Entity;
 
+use Galette\Core\I18n;
 use Galette\Features\Replacements;
 use Throwable;
 use Analog\Analog;
@@ -302,7 +303,7 @@ class Texts
                     );
 
                     try {
-                        $this->insert($this->zdb, [$values]);
+                        $this->insert([$values]);
                         return $this->getTexts($ref, $lang);
                     } catch (Throwable $e) {
                         Analog::log(
@@ -376,7 +377,7 @@ class Texts
      *
      * @return array: list of references used for texts
      */
-    public function getRefs($lang)
+    public function getRefs(string $lang = I18n::DEFAULT_LANG)
     {
         try {
             $select = $this->zdb->select(self::TABLE);
@@ -546,7 +547,7 @@ class Texts
      *
      * @return void
      */
-    private function insert($values)
+    private function insert(array $values)
     {
         $insert = $this->zdb->insert(self::TABLE);
         $insert->values(