Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

StringUtil.php + Notification center #8491

Closed
Alibi-Contao opened this issue Sep 16, 2016 · 7 comments
Closed

StringUtil.php + Notification center #8491

Alibi-Contao opened this issue Sep 16, 2016 · 7 comments
Labels

Comments

@Alibi-Contao
Copy link

Alibi-Contao commented Sep 16, 2016

Habe im Notification center folgenden Code für die Email-Ausgabe eingegeben:

{if form_rueckruf=="ja"}
Weitere Mitteilungen:a
{elseif form_aussendienst=="ja"}
Weitere Mitteilungen:b
{elseif form_angebot=="ja"}
Weitere Mitteilungen:c
{endif}

{if form_rueckruf=="ja"}

  • Um Rückruf wird gebeten.
    {endif}
    {if form_aussendienst=="ja"}
  • Ein Außendienst-Besuch ist gewünscht.
    {endif}
    {if form_angebot=="ja"}
  • Bitte schicken Sie mir ein Angebot.
    {endif}

Die Buchstaben a, b und c hinter "Weitere Mitteilungen:" dienen nur zur Kontrolle, welche Zeile in die Email verwendet wurde.
Ziel:
Wenn eine der Checkboxen aktivert wurde, soll die Zeile "Weitere Mitteilungen:" (und darunter die entsprechenden Texte) in die Email geschrieben werden.
Mit der "StringUtil.php" aus Contao 3.5.15 hat alles funkioniert, mit der Fassung aus Contao 3.5.16 leider nicht mehr.
Wenn man unter 3.5.16 die erste und die letzte Checkbox aktiviert, bekommt man das:
Weitere Mitteilungen:a
Weitere Mitteilungen:c

  • Um Rückruf wird gebeten.
  • Bitte schicken Sie mir ein Angebot.

Also zweimal "Weitere Mitteilungen:"
Siehe auch hier: https://community.contao.org/de/showthread.php?63978-Frage-zum-Notification-center

@leofeyer
Copy link
Member

Das Repo zum Notification Center ist hier: https://github.com/terminal42/contao-notification_center

@fritzmg
Copy link
Contributor

fritzmg commented Sep 16, 2016

It may be a bug with the new version of \StringUtil::parseSimpleTokens() introduced due to #8436
But I guess it needs to be tested by someone from terminal42 first.

@Toflar
Copy link
Member

Toflar commented Sep 26, 2016

This is not related to NC, if it is a bug, it's a Contao Core bug. I think the elseif is not skipped when the prepending if statement evaluates to true. I'll check this.

@Toflar
Copy link
Member

Toflar commented Sep 26, 2016

Bug confirmed. Will submit a PR, pls reopen.

@Toflar
Copy link
Member

Toflar commented Sep 26, 2016

This is the failing test to it: contao/core-bundle#579

@ausi
Copy link
Member

ausi commented Sep 26, 2016

Bugfix pull request: contao/core-bundle#580

@leofeyer
Copy link
Member

Thank you @Toflar and @ausi.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants