Skip to content

Attachment tokens not working when Contao is not in production mode! #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smohring opened this issue Jul 31, 2021 · 3 comments · Fixed by #242
Closed

Attachment tokens not working when Contao is not in production mode! #235

smohring opened this issue Jul 31, 2021 · 3 comments · Fixed by #242

Comments

@smohring
Copy link

Hi Guys,

I have a attachment template registered for a notification.
There will be only one path echo'ed within the template.
Unfortunately it is working only, if the site is in production mode.
Otherwise, Contao will add it's template tags, causing your logic to use more than the actial path - the "is_file" check will then fail.
See: system/modules/notification_center/library/NotificationCenter/Util/StringUtil.php:76

Template when "dev" mode is enabled - not working:

<!-- TEMPLATE START: templates/holtzbrinck-karriere.com/notification_applicant_attachment.html5 -->
files/mytestfile.zip
<!-- TEMPLATE END: templates/holtzbrinck-karriere.com/notification_applicant_attachment.html5 -->

Template, when "prod" mode is enabled - working:

files/mytestfile.zip
@aschempp
Copy link
Member

aschempp commented Sep 8, 2021

can you explain why you use a template to output a file path?

@fritzmg
Copy link
Collaborator

fritzmg commented Sep 8, 2021

@smohring can you please install and test dev-hotfix/token-attachment-templates?

@smohring
Copy link
Author

smohring commented Nov 4, 2021

Sorry guys, for miss testing, but thank you all for fixing the bug :) Appreciate it!

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

Successfully merging a pull request may close this issue.

3 participants