Problem/Motivation
When looking at depreactaion messages for rector/update bot i saw the following:
@trigger_error(__FUNCTION__ . 'is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use \Drupal\ckeditor5\Hook\Ckeditor5Hooks::updateCkeditor5HtmlFilter() instead. See https://www.drupal.org/node/3566774', E_USER_DEPRECATED);
That is actually missing a space which makes the message a bit weird. There are 3 places where this is the case right now. This MR fixes that.
Since this is not released yet, we could fix this quickly. Setting major since its time sensitive.
Working on this also showed that some deprecation messages for __FUNCTION__ and __METHOD__ are missing the "()" characters.
Steps to reproduce
na
Proposed resolution
Add a space when needed
Add parenthesis where they are missing in deprecation messages for __FUNCTION__ and __METHOD__.
Remove parenthesis where they are in deprecation messages for __CLASS__
Remaining tasks
Review
Commit
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3591520
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3591520-deprecation-message-in
changes, plain diff MR !15838
- 3591520-fix-for-main
changes, plain diff MR !15839
Comments
Comment #2
bbralaComment #4
bbralaComment #6
longwaveFWIW we can fix deprecation messages like this even after release - for example I'm pretty sure the links have been wrong before and we only noticed post-release.
Comment #7
nicxvan commentedI don't have access to the 11.x failures but I expect they are random.
Both branches look good!
Comment #8
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #9
bbralaHmm, if that is the case there is way more. A quick search for
__FUNCTION__ . ' is deprecatedshows quite a few hits. Do we include those here?Some are 11.4, but also quite a few 11.3
Comment #10
quietone commentedOh rats. Yea, we really should fix them all to conform to policy. I found 8 more on 11.x and 3 on main. Since this can be fixed via the command line, let's do that.
I'll add to my list to check the current RTBC issues for this particular error.
Changing the component to other since this now affects more than one system.
Comment #11
bbralaComment #12
dcam commentedNeither of the following commands turned up any additional instances of the problem in the branch for main:
grep -r "__FUNCTION__ . 'is" coregrep -r "__FUNCTION__ . ' is" coreBut the command
grep -r "__FUNCTION__ . ' is" coreturned up 5 instances in the branch for 11.x. They were located in the following files:core/modules/field_ui/field_ui.modulecore/modules/node/node.modulecore/modules/file/file.modulecore/modules/comment/src/Controller/CommentController.phpWere these omitted intentionally? I don't see anything about them that makes it look like they should be exceptions. Let me know if I missed something.
Comment #13
bbralaHmm no they weren't, good catch. Not sure how i missed those.
Comment #14
quietone commentedI was hoping to commit this but instead I have updated the MR for #12.
I then noticed more deprecation messages are missing the "()", so I fixed those and updated the issue summary for the changed scope.
Comment #15
quietone commentedComment #16
godotislateChanges on both MRs both look good to me. I am AFK though and have not checked existing branches to make sure there aren't any other instances that need fixing, but either way, these are improvements.
I'm guessing there are no additional instances that need fixing in 11.4.x?
Otherwise, RTBC +1.
Comment #17
dcam commentedI expanded my grep checks to cover the additional cases that were added. I didn't find any more in either branch. But I think I did find a mistake in MR 15838. Please check it.
Comment #18
quietone commentedThanks for the prompt reviews! I have updated to include searching for CLASS as well. I have updated the MR accordingly. Tests are passing and I have run the following wee script and didn't find any other problems.
Comment #19
dcam commentedI didn't find any additional issues. This one looks good to me.
Comment #25
godotislateCommitted and pushed 6a004b1f main, 87d9861 to 11.x, and af90abb to 11.4.x. Thanks!