Skip to content

Commit

Permalink
Correction dans l'affichage des images one_to_many.
Browse files Browse the repository at this point in the history
  • Loading branch information
noelma committed Sep 19, 2020
1 parent 88e1d5e commit ab1d326
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/modules/Node/Form/FormNode.php
Expand Up @@ -230,10 +230,11 @@ public function makeOneToMany($form, $key, $value, $options)
}

$subFields = $data->fetchAll();
$form->group("$key-group", 'div', function ($form) use ($key, $subFields, $options) {
$dir = $this->router->getBasePath();
$form->group("$key-group", 'div', function ($form) use ($key, $subFields, $options, $dir) {
foreach ($subFields as $field) {
$idEntity = $field[ "{$key}_id" ];
$form->group("$key-$idEntity-group", 'div', function ($form) use ($key, $idEntity, $options, $field) {
$form->group("$key-$idEntity-group", 'div', function ($form) use ($key, $idEntity, $options, $field, $dir) {
if (isset($options[ 'order_by' ]) && $options[ 'sort' ] == 'weight') {
$form->html("$key-$idEntity-drag", '<i class="fa fa-arrows-alt-v" aria-hidden="true"></i>')
->hidden("{$key}[$idEntity][weight]", [
Expand All @@ -245,7 +246,7 @@ public function makeOneToMany($form, $key, $value, $options)

$content = $field[ $options[ 'field_show' ] ];
if ($this->isShowFile($options, $field)) {
$src = $field[ $options[ 'field_type_show' ] ];
$src = $dir . $field[ $options[ 'field_type_show' ] ];
$content = "<img src='$src' class='img-thumbnail img-thumbnail-light'/>";
}

Expand Down

0 comments on commit ab1d326

Please sign in to comment.