-
-
Notifications
You must be signed in to change notification settings - Fork 829
[PHP8.2] declare deleteMessage on entityFormTrait
#25802
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
Conversation
(Standard links)
|
Php8.2 declare deleteMessage on the EntityFormTrait
f01f591
to
40ff199
Compare
@@ -66,7 +66,7 @@ | |||
{if $action eq 8} | |||
<div class="messages status no-popup"> | |||
{icon icon="fa-info-circle"}{/icon} | |||
{$deleteMessage} | |||
{$deleteMessage|smarty:nodefaults} |
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.
all the other tpl places have |escape
so I checked & here is what is assigned
public function setDeleteMessage() {
$this->deleteMessage = '<span class="font-red bold">'
. ts('WARNING: Deleting this membership will also delete any related payment (contribution) records.')
. ' '
. ts('This action cannot be undone.')
. '</span><p>'
. ts('Consider modifying the membership status instead if you want to maintain an audit trail and avoid losing payment data. You can set the status to Cancelled by editing the membership and clicking the Status Override checkbox.')
. '</p><p>'
. ts("Click 'Delete' if you want to continue.") . '</p>';
}
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.
So... sometimes $deleteMessage
is plain-text, and sometimes $deleteMessage
is HTML? Oof.
$futureDeveloper
will not expect that.
(For most of the plain-text examples in core, they'd probably work in either way. But it could make a difference when dealing with translated strings.)
We probably need an explanatory comment in the code.
entityFormTrait
entityFormTrait
Co-authored-by: Tim Otten <[email protected]>
Spot-checked a few screens, and they looked OK. Tests are passing. |
Overview
Php8.2 declare deleteMessage on
entityFormTrait
Before
Property used in a
getter
but not declared. It is declared on some but not all of the classes that implement the traitAfter
Declared on the trait, removed from implementing classes
Technical Details
Comments