backports murph-skeleton

This commit is contained in:
Simon Vieille 2021-03-24 20:40:56 +01:00
parent 5d2ae5ffb6
commit 249622485a
4 changed files with 18 additions and 4 deletions

View file

@ -53,7 +53,7 @@ class PasswordRequestEventSubscriber implements EventSubscriberInterface
$this->entityManager->update($user);
$this->notifier
->setSubject($translator->trans('Mot de passe perdu'))
->setSubject($this->translator->trans('Mot de passe perdu'))
->addRecipient($user->getEmail())
->notify('@Core/mail/account/resetting_request.html.twig', [
'reseting_update_link' => $this->urlGenerator->generate(

View file

@ -83,11 +83,13 @@ class NodeEventSubscriber extends EntityManagerEventSubscriber
}
$parameters = $node->getParameters();
$routeParameters = [];
foreach ($parameters as $key => $parameter) {
$parameter['name'] = $this->routeParameterSlugify->slugify($parameter['name']);
$routeParameter = sprintf('{%s}', $parameter['name']);
$regex = '/'.preg_quote($routeParameter).'/';
$routeParameters[] = $parameter['name'];
if (!preg_match($regex, $generatedUrl)) {
$generatedUrl .= '/'.$routeParameter;
@ -96,6 +98,20 @@ class NodeEventSubscriber extends EntityManagerEventSubscriber
$parameters[$key] = $parameter;
}
preg_match_all('/\{(.*)\}/isU', $generatedUrl, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
if (!in_array($match[1], $routeParameters)) {
$parameters[] = [
'name' => $this->routeParameterSlugify->slugify($match[1]),
'defaultValue' => null,
'requirement' => null,
];
}
}
$generatedUrl = str_replace('//', '/', $generatedUrl);
$node->setParameters($parameters);
$attributes = $node->getAttributes();

View file

@ -67,7 +67,7 @@
"New parameter": "Nouveau paramètre"
"New attribut": "Nouveau attribut"
"New menu": "Nouveau menu"
"New": "Nouveau menu"
"New": "Nouveau"
"No action": "Aucune action"
"Route name: <code>%routeName%</code>": "Nom de la route : <code>%routeName%</code>"
"Content": "Contenu"

View file

@ -115,8 +115,6 @@
{% if node.hasExternalUrl %}
<a href="{{ node.url }}" class="btn btn-sm border border-secondary btn-light">
<span class="fa fa-sign-out-alt text-muted"></span>
{{ node.url }}
</a>
{% else %}
{% if node.parameters|length %}