fix saves & close action on document and images. Fix #402
This commit is contained in:
@@ -35,6 +35,7 @@ use Thelia\Model\ProductDocument;
|
||||
use Thelia\Model\ProductImage;
|
||||
use Thelia\Tools\FileManager;
|
||||
use Thelia\Tools\Rest\ResponseRest;
|
||||
use Thelia\Tools\URL;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
@@ -389,7 +390,7 @@ class FileController extends BaseAdminController
|
||||
$this->adminLogAppend(AdminResources::retrieve($parentType), AccessManager::UPDATE, sprintf('Image with Ref %s (ID %d) modified', $imageUpdated->getTitle(), $imageUpdated->getId()));
|
||||
|
||||
if ($this->getRequest()->get('save_mode') == 'close') {
|
||||
$this->redirectToRoute('admin.images');
|
||||
$this->redirect(URL::getInstance()->absoluteUrl($fileManager->getRedirectionUrl($parentType, $image->getParentId(), FileManager::FILE_TYPE_IMAGES)));
|
||||
} else {
|
||||
$this->redirectSuccess($imageModification);
|
||||
}
|
||||
@@ -466,7 +467,7 @@ class FileController extends BaseAdminController
|
||||
$this->adminLogAppend(AdminResources::retrieve($parentType), AccessManager::UPDATE, sprintf('Document with Ref %s (ID %d) modified', $documentUpdated->getTitle(), $documentUpdated->getId()));
|
||||
|
||||
if ($this->getRequest()->get('save_mode') == 'close') {
|
||||
$this->redirectToRoute('admin.documents');
|
||||
$this->redirect(URL::getInstance()->absoluteUrl($fileManager->getRedirectionUrl($parentType, $document->getParentId(), FileManager::FILE_TYPE_DOCUMENTS)));
|
||||
} else {
|
||||
$this->redirectSuccess($documentModification);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
hide_submit_buttons = false
|
||||
|
||||
page_url = "{url path="/admin/document/type/{$documentType}/{$ID}/update"}"
|
||||
close_url = "{url path="{$redirectUrl}"}"
|
||||
close_url = "{url path="{$redirectUrl}" noamp=1}"
|
||||
}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
hide_submit_buttons = false
|
||||
|
||||
page_url = "{url path="/admin/image/type/{$imageType}/{$ID}/update"}"
|
||||
close_url = "{url path="{$redirectUrl}"}"
|
||||
close_url = "{url path="{$redirectUrl}" noamp=1}"
|
||||
}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
Reference in New Issue
Block a user