]> git.agnieray.net Git - galette.git/commitdiff
Fix storage issue; refs #1393
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 6 Dec 2020 11:27:43 +0000 (12:27 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 6 Dec 2020 11:30:02 +0000 (12:30 +0100)
galette/lib/Galette/Controllers/PdfController.php
tests/Galette/Entity/tests/units/PdfModel.php

index 4243d73d41bce1f1ff291d5dd83e6c121f026325..76e95ca5ec401785c81778519c212b47d630865a 100644 (file)
@@ -605,7 +605,7 @@ class PdfController extends AbstractController
                 $model->type = $type;
                 foreach ($fields as $pvar => $prop) {
                     if (isset($post[$pvar])) {
-                        $model->$prop = $pvar;
+                        $model->$prop = $post[$pvar];
                     }
                 }
 
index 16080a120650e6ea01ffe74564810eb73a2f274a..8d4dc85b560d34d080e97f534c46d74bb2825bee 100644 (file)
@@ -128,6 +128,10 @@ class PdfModel extends atoum
             $this->members_fields,
             $this->history
         );
+
+        global $container, $zdb;
+        $zdb = $this->zdb; //globals '(
+        $container = $this->container; //globals '(
     }
 
     /**
@@ -171,9 +175,6 @@ class PdfModel extends atoum
      */
     public function testExpectedPatterns()
     {
-        global $container, $zdb;
-        $zdb = $this->zdb; //globals '(
-        $container = $this->container; //globals '(
         $model = new class ($this->zdb, $this->preferences, 1) extends \Galette\Entity\PdfModel {
         };
 
@@ -294,10 +295,6 @@ class PdfModel extends atoum
      */
     public function testReplacements()
     {
-        global $container, $zdb;
-        $zdb = $this->zdb; //globals '(
-        $container = $this->container; //globals '(
-
         //create dynamic fields
         $field_data = [
             'form_name'        => 'adh',