Browse Source

Correction du slug vide dans l'édition

Sangfroid 1 month ago
parent
commit
4aaef7b1c6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      templates/article/_form.html.twig

+ 1 - 1
templates/article/_form.html.twig

@@ -7,7 +7,7 @@
 
         {% set cacherFormulaire = article.slug and not article.slug is same as '' and form.children.slug.vars.errors|length == 0 %}
         <div data-slugger-target="ligneSlug" class="ligne-slug {{ cacherFormulaire ? '' : 'hidden' }}">
-            <div><span>Permalien</span> {{ url('app_view', {slug: article.slug}) }}</div>
+            <div><span>Permalien</span> {% if article.slug %}{{ url('app_view', {slug: article.slug}) }}{% endif %}</div>
             <button type="button" class="bouton-slug" data-slugger-target="bouton-show" data-action="click->slugger#show">Modifier</button>
         </div>
         <div id="formulaire-slug" data-slugger-target="formulaire" class="{{ cacherFormulaire ? 'hidden' : ''}}">