Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As per the checkplain documentation at https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Safe...
it will be Will be removed before Drupal 9.0.0.
Comment | File | Size | Author |
---|---|---|---|
#11 | replace_checkplain-2785387-11.patch | 940 bytes | martin107 |
#4 | interdiff-2785387-2-4.txt | 605 bytes | martin107 |
#4 | replace_checkplain-2785387-4.patch | 1.18 KB | martin107 |
#2 | replace_checkplain-2785387-2.patch | 885 bytes | Sahil Khambra |
Comments
Comment #2
Sahil Khambra CreditAttribution: Sahil Khambra as a volunteer and at Trigyn Technologies Ltd commentedSafeMarkup::checkPlain is replaced by Html::escape
Comment #3
Sahil Khambra CreditAttribution: Sahil Khambra as a volunteer and at Trigyn Technologies Ltd commentedComment #4
martin107 CreditAttribution: martin107 commentedYes the method is deprecated, so +1 on the idea behind the issue.
Patch looks clean. - great
Looking at the deprecation note
breaking that down into a decision flow chart.
If we can assume output will always go into a twig template and will be auto escaped then escape() call is not needed?
I see NumericArgument::getTitle() which we override makes that assumption!
It is free to have an "abundance of caution", so for the moment I am leaving it as it...maybe someone else can comment?
My patch attaches a small fix up.... during review I noticed that we override NumericArgument::getTitle() it is not on any interface
so @inheritdoc is incorrect. When I use doxygen I can confirm that the method documentation is incorrectly blank ... so I have added it in.
Please feel free to object to what I have done and commit the patch from #2.
Comment #5
socketwench CreditAttribution: socketwench commentedThese type of deprecations aren't a high priority for me, which is why I haven't gone out of my way to remove them. I have no problems if anyone else wants to go for it though. ^_~
Right now I think there's nothing wrong with an "abundance of caution".
Comment #6
socketwench CreditAttribution: socketwench commentedComment #7
joachim CreditAttribution: joachim commented>My patch attaches a small fix up.... during review I noticed that we override NumericArgument::getTitle() it is not on any interface
I see it in the parent class Drupal\views\Plugin\views\argument\NumericArgument:
Inheritdoc is valid for overrides of a parent class, surely?
Comment #8
martin107 CreditAttribution: martin107 commentedFrom https://www.drupal.org/coding-standards/docs#inheritdoc
My mistake - overriding or implementing. It one of those instances where doxygen and d8 standards diverge - no biggie.
I am easy - I would be happy to see the patch from #2 go forward.
Comment #9
martin107 CreditAttribution: martin107 commentedComment #10
joachim CreditAttribution: joachim commentedThe old class is still being imported:
> use Drupal\Component\Utility\SafeMarkup;
Comment #11
martin107 CreditAttribution: martin107 commenteddone
Comment #14
martin107 CreditAttribution: martin107 commentedComment #16
socketwench CreditAttribution: socketwench commentedNo longer finding any references to SafeMarkup. Thanks Martin!
Comment #17
socketwench CreditAttribution: socketwench commented