From 64d8e2fef6899c5f65368ed263eb667a7b3cc3ef Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Sun, 29 Jan 2023 15:25:41 -0800 Subject: [PATCH] Replace usage of the bbmd filter It's just an alias of the `markdown` one, so let's use that one directly and mark this one as deprecated --- src/library/Box/TwigExtensions.php | 6 +++--- .../html_client/mod_custompages_content.html.twig | 2 +- src/modules/Example/html_admin/mod_example_index.html.twig | 2 +- .../Extension/html_admin/mod_extension_index.html.twig | 2 +- .../Invoice/html_admin/mod_invoice_invoice.html.twig | 2 +- src/modules/Kb/html_client/mod_kb_article.html.twig | 2 +- src/modules/News/html_client/mod_news_post.html.twig | 2 +- src/modules/Order/html_client/mod_order_manage.html.twig | 2 +- .../html_client/mod_orderbutton_addons.html.twig | 2 +- .../mod_orderbutton_product_configuration.html.twig | 2 +- src/modules/Page/html_client/mod_page_about-us.html.twig | 2 +- .../Page/html_client/mod_page_preview_markdown.html.twig | 2 +- .../Page/html_client/mod_page_privacy-policy.html.twig | 2 +- src/modules/Page/html_client/mod_page_tos.html.twig | 2 +- .../Support/html_admin/mod_support_public_ticket.html.twig | 2 +- src/modules/Support/html_admin/mod_support_ticket.html.twig | 2 +- .../mod_support_contact_us_conversation.html.twig | 2 +- .../Support/html_client/mod_support_ticket.html.twig | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/library/Box/TwigExtensions.php b/src/library/Box/TwigExtensions.php index 7f55baf26..049325206 100644 --- a/src/library/Box/TwigExtensions.php +++ b/src/library/Box/TwigExtensions.php @@ -329,10 +329,10 @@ function twig_truncate_filter(Twig\Environment $env, $value, $length = 30, $pres /** * BoxBilling markdown. + * @deprecated */ function twig_bbmd_filter(Twig\Environment $env, $value) { - $value = twig_markdown_filter($env, $value); - - return $value; + error_log('Usage for deprected bbmd filter, please use the markdown filter instead for twig templates.'); + return twig_markdown_filter($env, $value); } diff --git a/src/modules/Custompages/html_client/mod_custompages_content.html.twig b/src/modules/Custompages/html_client/mod_custompages_content.html.twig index 86aaac152..7dbaf7725 100644 --- a/src/modules/Custompages/html_client/mod_custompages_content.html.twig +++ b/src/modules/Custompages/html_client/mod_custompages_content.html.twig @@ -19,7 +19,7 @@

{{ page.title }}

- {{ page.content | bbmd }} + {{ page.content | markdown }}
diff --git a/src/modules/Example/html_admin/mod_example_index.html.twig b/src/modules/Example/html_admin/mod_example_index.html.twig index 36b7401d3..12d2c7796 100644 --- a/src/modules/Example/html_admin/mod_example_index.html.twig +++ b/src/modules/Example/html_admin/mod_example_index.html.twig @@ -64,7 +64,7 @@
{{ 'README'|trans }}
- {{ guest.example_readme | bbmd }} + {{ guest.example_readme | markdown }}
{% endblock %} diff --git a/src/modules/Extension/html_admin/mod_extension_index.html.twig b/src/modules/Extension/html_admin/mod_extension_index.html.twig index ebcf4f8cb..7ef4a99bc 100644 --- a/src/modules/Extension/html_admin/mod_extension_index.html.twig +++ b/src/modules/Extension/html_admin/mod_extension_index.html.twig @@ -106,7 +106,7 @@

{{ 'Automatic update'|trans }}

{{ 'Automatic updater is a tool to update FOSSBilling to latest version in one click. Works on these hosting environments where PHP has permissions to overwrite files uploaded via FTP.'|trans }}

- {{ admin.system_release_notes|bbmd }} + {{ admin.system_release_notes|markdown }} diff --git a/src/modules/Invoice/html_admin/mod_invoice_invoice.html.twig b/src/modules/Invoice/html_admin/mod_invoice_invoice.html.twig index 476f76b4b..93e838ab3 100644 --- a/src/modules/Invoice/html_admin/mod_invoice_invoice.html.twig +++ b/src/modules/Invoice/html_admin/mod_invoice_invoice.html.twig @@ -115,7 +115,7 @@ {% if invoice.notes %}
{{ 'Notes'|trans }}: - {{ invoice.notes|bbmd }} + {{ invoice.notes|markdown }}
{% endif %} diff --git a/src/modules/Kb/html_client/mod_kb_article.html.twig b/src/modules/Kb/html_client/mod_kb_article.html.twig index f49c6a245..9fe23a579 100644 --- a/src/modules/Kb/html_client/mod_kb_article.html.twig +++ b/src/modules/Kb/html_client/mod_kb_article.html.twig @@ -24,7 +24,7 @@

{{ 'Article views'|trans }}: {{ article.views }}

- {{ article.content|bbmd }} + {{ article.content|markdown }}

{{ 'Back to list'|trans }}

diff --git a/src/modules/News/html_client/mod_news_post.html.twig b/src/modules/News/html_client/mod_news_post.html.twig index 939a36f79..732c1102c 100644 --- a/src/modules/News/html_client/mod_news_post.html.twig +++ b/src/modules/News/html_client/mod_news_post.html.twig @@ -35,7 +35,7 @@
{% if post.image %}{{ post.title }}{% endif %} - {{ post.content|bbmd }} + {{ post.content|markdown }} {# if post.tags %}Tags: {{ post.tags|join(', ') }}{% endif #} {% if guest.extension_is_on({ "mod": "comment" }) %}{% include "mod_comment_block.html.twig" %}{% endif %} diff --git a/src/modules/Order/html_client/mod_order_manage.html.twig b/src/modules/Order/html_client/mod_order_manage.html.twig index 5ca623bbc..783680d12 100644 --- a/src/modules/Order/html_client/mod_order_manage.html.twig +++ b/src/modules/Order/html_client/mod_order_manage.html.twig @@ -75,7 +75,7 @@ {% if order.notes %} - {{ order.notes|bbmd }} + {{ order.notes|markdown }} {% endif %} diff --git a/src/modules/Orderbutton/html_client/mod_orderbutton_addons.html.twig b/src/modules/Orderbutton/html_client/mod_orderbutton_addons.html.twig index 4e6e446a2..e5091dd77 100644 --- a/src/modules/Orderbutton/html_client/mod_orderbutton_addons.html.twig +++ b/src/modules/Orderbutton/html_client/mod_orderbutton_addons.html.twig @@ -22,7 +22,7 @@ - {{ addon.description|bbmd }} + {{ addon.description|markdown }} diff --git a/src/modules/Orderbutton/html_client/mod_orderbutton_product_configuration.html.twig b/src/modules/Orderbutton/html_client/mod_orderbutton_product_configuration.html.twig index 4f1fee4a0..5f97e91eb 100644 --- a/src/modules/Orderbutton/html_client/mod_orderbutton_product_configuration.html.twig +++ b/src/modules/Orderbutton/html_client/mod_orderbutton_product_configuration.html.twig @@ -11,7 +11,7 @@ {% set product_details %}
{{ product.title }} - {{ product.description | bbmd }} + {{ product.description | markdown }} {% if product.pricing.type == 'recurrent' %} {% set periods = guest.system_periods %} diff --git a/src/modules/Page/html_client/mod_page_about-us.html.twig b/src/modules/Page/html_client/mod_page_about-us.html.twig index b0b9369f9..e21b34051 100644 --- a/src/modules/Page/html_client/mod_page_about-us.html.twig +++ b/src/modules/Page/html_client/mod_page_about-us.html.twig @@ -17,7 +17,7 @@

{{ company.signature }}

- {{ company.note|bbmd }} + {{ company.note|markdown }}
diff --git a/src/modules/Page/html_client/mod_page_preview_markdown.html.twig b/src/modules/Page/html_client/mod_page_preview_markdown.html.twig index ef0f68876..178042cd8 100644 --- a/src/modules/Page/html_client/mod_page_preview_markdown.html.twig +++ b/src/modules/Page/html_client/mod_page_preview_markdown.html.twig @@ -14,7 +14,7 @@
- {{ post.content|bbmd }} + {{ post.content|markdown }}
\ No newline at end of file diff --git a/src/modules/Page/html_client/mod_page_privacy-policy.html.twig b/src/modules/Page/html_client/mod_page_privacy-policy.html.twig index 297c93078..92582aa00 100644 --- a/src/modules/Page/html_client/mod_page_privacy-policy.html.twig +++ b/src/modules/Page/html_client/mod_page_privacy-policy.html.twig @@ -18,7 +18,7 @@

{{ company.signature }}

- {{ company.privacy_policy|bbmd }} + {{ company.privacy_policy|markdown }}
diff --git a/src/modules/Page/html_client/mod_page_tos.html.twig b/src/modules/Page/html_client/mod_page_tos.html.twig index fa6764ef0..8f1ffd7df 100644 --- a/src/modules/Page/html_client/mod_page_tos.html.twig +++ b/src/modules/Page/html_client/mod_page_tos.html.twig @@ -17,7 +17,7 @@

{{ company.signature }}

- {{ company.tos|bbmd }} + {{ company.tos|markdown }}
diff --git a/src/modules/Support/html_admin/mod_support_public_ticket.html.twig b/src/modules/Support/html_admin/mod_support_public_ticket.html.twig index 4d7539364..940e663b0 100644 --- a/src/modules/Support/html_admin/mod_support_public_ticket.html.twig +++ b/src/modules/Support/html_admin/mod_support_public_ticket.html.twig @@ -157,7 +157,7 @@ {{ message.created_at|bb_datetime }}
- {{ message.content|bbmd }} + {{ message.content|markdown }}
{% endfor %} diff --git a/src/modules/Support/html_admin/mod_support_ticket.html.twig b/src/modules/Support/html_admin/mod_support_ticket.html.twig index c301b5b32..e6ea3bb0e 100644 --- a/src/modules/Support/html_admin/mod_support_ticket.html.twig +++ b/src/modules/Support/html_admin/mod_support_ticket.html.twig @@ -287,7 +287,7 @@ {{ message.created_at|bb_datetime }}
- {{ message.content|bbmd }} + {{ message.content|markdown }}
{% endfor %} diff --git a/src/modules/Support/html_client/mod_support_contact_us_conversation.html.twig b/src/modules/Support/html_client/mod_support_contact_us_conversation.html.twig index 614c6d7fe..165dca085 100644 --- a/src/modules/Support/html_client/mod_support_contact_us_conversation.html.twig +++ b/src/modules/Support/html_client/mod_support_contact_us_conversation.html.twig @@ -89,7 +89,7 @@
-
{{ message.content|bbmd }}
+
{{ message.content|markdown }}
diff --git a/src/modules/Support/html_client/mod_support_ticket.html.twig b/src/modules/Support/html_client/mod_support_ticket.html.twig index b1c87d16d..61ee189ca 100644 --- a/src/modules/Support/html_client/mod_support_ticket.html.twig +++ b/src/modules/Support/html_client/mod_support_ticket.html.twig @@ -135,7 +135,7 @@ {% endif %}
-
{{ message.content|bbmd }}
+
{{ message.content|markdown }}