Skip to content

Commit

Permalink
fix request token error
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Nov 28, 2023
1 parent 4843c7b commit fad0703
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions composer.json
Expand Up @@ -41,5 +41,11 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16 || ^3.0"
},
"config": {
"allow-plugins": {
"php-http/discovery": false,
"contao-components/installer": true
}
}
}
2 changes: 1 addition & 1 deletion src/EventListener/ParseWidgetListener.php
Expand Up @@ -17,7 +17,7 @@
use Contao\Widget;
use Symfony\Contracts\Service\ResetInterface;

/**
/**
* @Hook("parseWidget")
*/
class ParseWidgetListener implements ResetInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Form/BackendForm.php
Expand Up @@ -38,7 +38,7 @@ public function generate(string $templateName = null): string
$container = System::getContainer();
/** @var ContaoCsrfTokenManager $tokenManager */
$tokenManager = $container->get('contao.csrf.token_manager');
$tokenName = $container->getParameter('%contao.csrf_token_name%');
$tokenName = $container->getParameter('contao.csrf_token_name');

$template = new FrontendTemplate($templateName);
$template->legend = $this->legend;
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/templates/form_backend.html5
Expand Up @@ -9,7 +9,7 @@
<form<?php if ($this->action): ?> action="<?= $this->action ?>"<?php endif; ?> method="<?= $this->method ?>" enctype="<?= $this->enctype ?>" class="tl_form tl_edit_form"<?= $this->novalidate ?>>
<?php if ($this->method != 'get'): ?>
<input type="hidden" name="FORM_SUBMIT" value="<?= $this->formSubmit ?>">
<input type="hidden" name="REQUEST_TOKEN" value="<?= $requestToken ?>">
<input type="hidden" name="REQUEST_TOKEN" value="<?= $this->requestToken ?>">
<?php if ($this->maxFileSize): ?>
<input type="hidden" name="MAX_FILE_SIZE" value="<?= $this->maxFileSize ?>">
<?php endif; ?>
Expand Down

0 comments on commit fad0703

Please sign in to comment.