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
Variable Substitution - Project Variables Not Working #19953
Comments
Bug description updated. |
From what I can see in the report the problem is that the PROJECT substitutions are only provided when $object "Has-A Project". There is not logical code-block to provide substitutions when $object "Is-A Project". For example: if (is_object($object) && get_class($object) === 'Project') |
This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required). |
this is still a bug on dolibarr 18.0.1 |
Bug
The following variables do not work in email templates.
Environment Version
13.0.1
Environment OS
Ubuntu 18.04.5 LTS
Environment Web server
Apache/2.4.29 (Ubuntu)
Environment PHP
PHP 7.2.24
Environment Database
MariaDB
Environment URL(s)
/admin/mails_templates.php
Expected and actual behavior
The following Variable Substitutions are not populating the Project Emails as expected:
When using any of the above variables, the email message body just prints their key.
Example of variable in an email message:
The expected behavior would be:
Print out the Project id for
__PROJECT_ID__
Print out the Project ref for
__PROJECT_REF__
Print out the Project title for
__PROJECT_NAME__
I am pretty confident that the following lines in
htdocs/core/lib/functions.lib.php
never get hit:I will note that even though the following code does not exist in
htdocs/core/lib/functions.lib.php
, it will print out the expected values in Project emails when they are added outside of the conditional blocks forif (is_object($object->project))
andif (is_object($object->projet))
:Steps to reproduce the behavior
Create a project email template with any of these variables:
Send a Project email using the email template.
Attached files
No response
The text was updated successfully, but these errors were encountered: