-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
use object contact as priority in MAIN_MAIL_NO_WITH_TO_SELECTED #30143
base: develop
Are you sure you want to change the base?
use object contact as priority in MAIN_MAIL_NO_WITH_TO_SELECTED #30143
Conversation
@@ -1096,7 +1097,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove | |||
*/ | |||
public function getHtmlForTo() | |||
{ | |||
global $langs, $form; | |||
global $langs, $form, $object; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using $object as global variable has unpredicable results. ($object is often used by different purposes).
Also later having the selection of $withtoselected done inside the method breaks the idea of the component html.formmail.class.
So I suggest to add a proterty ->withtoselected into the component html.formmail.class that will be used to set $withtoselected if defined.
So the content of the preselected email can be set by the caller by setting ->withtoselected.
The code added into this method to set $withtoselected can then be moved into the caller to fill ->withtoselected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i use global to be as close as possible with other dolibarr code, but that's a good news to avoid global object :)
@eldy done |
See #29759 : mail to is not auto selected, that is a "user bug" not a "code bug" -> develop ... maybe in 20.0 (or too late) ?