diff --git a/library/Class/ModeleFusion.php b/library/Class/ModeleFusion.php index 88a0db416dbe4b0683f6be3087cd526d1ed3cb46..a7e2352587c919963fa0422860d0a3157253e184 100644 --- a/library/Class/ModeleFusion.php +++ b/library/Class/ModeleFusion.php @@ -63,11 +63,7 @@ class Class_ModeleFusion extends Storm_Model_Abstract { public function getDataSourceNamed($name) { - $this->dataSource=array_at($name, $this->getDataSource()); - return $this->dataSource; - if (!$this->dataSource) - return $this->dataSource=array_at($name, $this->getDataSource()); - return $this->dataSource->callGetterByAttributeName($name); + return array_at($name, $this->getDataSource()); } @@ -142,9 +138,9 @@ class Class_ModeleFusion extends Storm_Model_Abstract { $model = $instance->callGetterByAttributeName(array_shift($attributes)); if (!$model) return ''; + if (is_array($value = $this->getValue($model, $attributes))) return $this->buildSection($value,array_shift($match)); -// return $this->buildTable($value, array_shift($match)); return $this->htmlize($value); } @@ -161,12 +157,16 @@ class Class_ModeleFusion extends Storm_Model_Abstract { } else $attributes =[ $match]; - xdebug_break(); + $model = $this->getDataSourceNamed(array_shift($attributes)); - if (is_array($value = $this->getValue($model, $attributes))) + $value = $this->getValue($model, $attributes); + + if (is_array($value) && ($this->getNom() === 'recherche' || $this->getNom() === 'article')) return $this->buildSection($value,array_shift($match)); -// return $this->buildTable($value, array_shift($match)); + + if (is_array($value)) + return $this->buildTable($value, array_shift($match)); return $this->htmlize($value); } diff --git a/tests/application/modules/admin/controllers/FormationControllerTest.php b/tests/application/modules/admin/controllers/FormationControllerTest.php index 9085a2fb6bd4be3683845e63e72d52e12375d280..757b9b1ef414c08d84aa11ce37458f5cb689a6cc 100644 --- a/tests/application/modules/admin/controllers/FormationControllerTest.php +++ b/tests/application/modules/admin/controllers/FormationControllerTest.php @@ -1831,7 +1831,7 @@ class FormationControllerFicheEmargementSessionJavaFevrierTest extends Formation /** @test */ public function pageShouldContainsTableWithNomPrenom() { - $this->assertXPathContentContains('//table//td', 'Curzillat'); + $this->assertXPathContentContains('//table//td', 'Curzillat', $this->_response->getBody()); $this->assertXPathContentContains('//table//td', 'Benoit'); }