Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6eba77c

Browse filesBrowse files
committed
Revert "[#11375] Removed the workflow_transition_blockers from 4.2 docs" in 4.3
This reverts commit f673d4d.
1 parent c6ea98e commit 6eba77c
Copy full SHA for 6eba77c

File tree

1 file changed

+25
-0
lines changed
Filter options

1 file changed

+25
-0
lines changed

‎workflow/usage.rst

Copy file name to clipboardExpand all lines: workflow/usage.rst
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,31 @@ transition was blocked::
588588
}
589589
}
590590

591+
You can access the message from a Twig template as follows:
592+
593+
.. code-block:: html+twig
594+
595+
<h2>Publication was blocked because:</h2>
596+
<ul>
597+
{% for transition in workflow_all_transitions(article) %}
598+
{% if not workflow_can(article, transition.name) %}
599+
<li>
600+
<strong>{{ transition.name }}</strong>:
601+
<ul>
602+
{% for blocker in workflow_transition_blockers(article, transition.name) %}
603+
<li>
604+
{{ blocker.message }}
605+
{% if blocker.parameters.expression is defined %}
606+
<code>{{ blocker.parameters.expression }}</code>
607+
{% endif %}
608+
</li>
609+
{% endfor %}
610+
</ul>
611+
</li>
612+
{% endif %}
613+
{% endfor %}
614+
</ul>
615+
591616
Don't need a human-readable message? You can still use::
592617

593618
$event->setBlocked('true');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.