Skip to content

Commit

Permalink
Fixed containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Allimant committed Dec 12, 2024
1 parent 82f2e41 commit 0a030b0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.0.3</version>
<version>2.0.4</version>
<authors>
<author>
<name>Maxime BRUCHET</name>
Expand Down
5 changes: 3 additions & 2 deletions Form/SelectionUpdateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ function (FormEvent $event) {
$selectionContainerWrongValue = $data['selection_container'];
$data['selection_container_id'] = null;
if (null !== $selectionContainerWrongValue) {
$selectionContainerValue = $this->containersArray[$selectionContainerWrongValue];
$data['selection_container_id'] = $selectionContainerValue;
$data['selection_container_id'] = $selectionContainerWrongValue;
// $selectionContainerValue = $this->containersArray[$selectionContainerWrongValue];
// $data['selection_container_id'] = $selectionContainerValue;
}
$event->setData($data);
}
Expand Down
6 changes: 3 additions & 3 deletions Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class Selection extends BaseModule
*/
public function postActivation(ConnectionInterface $con = null): void
{
try {
SelectionQuery::create()->findOne();
} catch (\Exception $e) {
if (! self::getConfigValue('is_initialized')) {
$database = new Database($con);
$database->insertSql(null, [__DIR__ . '/Config/TheliaMain.sql']);

self::setConfigValue('is_initialized', true);
}

$this->addRessource(self::RESOURCES_SELECTION);
Expand Down
5 changes: 3 additions & 2 deletions templates/backOffice/default/container-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<li><a href="{url path='/admin/selection'}">{intl l="Selection" d='selection.bo.default'}</a></li>
<li><a href="{url path='/admin/selection/container/update/%selectionContainerId' selectionContainerId=$selected_container_id|default:null}">{intl l="Container" d='selection.bo.default'} {$selected_container_id} {intl l="(Modification)"}</a></li>
</ul>
{if $message != ""}
{if $message|default:'' != ""}
<div class="row">
<div class="alert-block">
<div class="col-md-12">
Expand All @@ -29,6 +29,7 @@
</div>
{/if}
{include file="selection-list-selections.html" }
</div>
{/block}

{block name="javascript-last-call"}
Expand All @@ -47,4 +48,4 @@
{/javascripts}

{include file="selection-list-selections.js"}
{/block}
{/block}
4 changes: 2 additions & 2 deletions templates/backOffice/default/image-upload-list-ajax.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{$selection_id=$selection_id|default:null}
{ifloop rel="selection_image"}
<ul id="js-sort-image" class="row list-unstyled">
{loop type="selection_image" name="selection_image" backend_context="on" lang="$edit_language_id" source=$imageType order="manual" source_id=$parentId width="200" height="100" resize_mode="borders" visible="*"}
{loop type="selection_image" name="selection_image" backend_context="on" lang="$edit_language_id" source=$imageType order="manual" source_id=$parentId|default:0 width="200" height="100" resize_mode="borders" visible="*"}

<li class="col-sm-6 col-md-3 ui-state-default" data-sort-id="{$ID}">

Expand Down Expand Up @@ -61,4 +61,4 @@
{/ifloop}
{elseloop rel="selection_image"}
<div class="alert alert-info">{intl l='There is no images attached to this %type.' type={$imageType} d='selection.bo.default'}</div>
{/elseloop}
{/elseloop}
3 changes: 2 additions & 1 deletion templates/backOffice/default/selection-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{/if}
{include file="selection-list-containers.html"}
{include file="selection-list-selections.html"}
</div>
{/block}

{block name="javascript-last-call"}
Expand All @@ -48,4 +49,4 @@

{include file="selection-list-containers.js"}
{include file="selection-list-selections.js"}
{/block}
{/block}

0 comments on commit 0a030b0

Please sign in to comment.