Skip to content
Snippets Groups Projects
Commit 4e3c1115 authored by Ghislain Loas's avatar Ghislain Loas Committed by efalcy
Browse files

fix compatibility with formation modelFusion

parent 55540c41
5 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1120Master,!1079Dev #17782 merge print fusion,!1073Dev#17782 bonus 1 imprimer la liste des notices,!1062Sandbox fusion search result and print
...@@ -63,11 +63,7 @@ class Class_ModeleFusion extends Storm_Model_Abstract { ...@@ -63,11 +63,7 @@ class Class_ModeleFusion extends Storm_Model_Abstract {
public function getDataSourceNamed($name) { public function getDataSourceNamed($name) {
$this->dataSource=array_at($name, $this->getDataSource()); return array_at($name, $this->getDataSource());
return $this->dataSource;
if (!$this->dataSource)
return $this->dataSource=array_at($name, $this->getDataSource());
return $this->dataSource->callGetterByAttributeName($name);
} }
...@@ -142,9 +138,9 @@ class Class_ModeleFusion extends Storm_Model_Abstract { ...@@ -142,9 +138,9 @@ class Class_ModeleFusion extends Storm_Model_Abstract {
$model = $instance->callGetterByAttributeName(array_shift($attributes)); $model = $instance->callGetterByAttributeName(array_shift($attributes));
if (!$model) if (!$model)
return ''; return '';
if (is_array($value = $this->getValue($model, $attributes))) if (is_array($value = $this->getValue($model, $attributes)))
return $this->buildSection($value,array_shift($match)); return $this->buildSection($value,array_shift($match));
// return $this->buildTable($value, array_shift($match));
return $this->htmlize($value); return $this->htmlize($value);
} }
...@@ -161,12 +157,16 @@ class Class_ModeleFusion extends Storm_Model_Abstract { ...@@ -161,12 +157,16 @@ class Class_ModeleFusion extends Storm_Model_Abstract {
} }
else $attributes =[ $match]; else $attributes =[ $match];
xdebug_break();
$model = $this->getDataSourceNamed(array_shift($attributes)); $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->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); return $this->htmlize($value);
} }
......
...@@ -1831,7 +1831,7 @@ class FormationControllerFicheEmargementSessionJavaFevrierTest extends Formation ...@@ -1831,7 +1831,7 @@ class FormationControllerFicheEmargementSessionJavaFevrierTest extends Formation
/** @test */ /** @test */
public function pageShouldContainsTableWithNomPrenom() { public function pageShouldContainsTableWithNomPrenom() {
$this->assertXPathContentContains('//table//td', 'Curzillat'); $this->assertXPathContentContains('//table//td', 'Curzillat', $this->_response->getBody());
$this->assertXPathContentContains('//table//td', 'Benoit'); $this->assertXPathContentContains('//table//td', 'Benoit');
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment