Closed (outdated)
Project:
Drupal core
Version:
9.5.x-dev
Component:
plugin system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Sep 2016 at 11:04 UTC
Updated:
24 Dec 2022 at 09:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dishabhadra commentedComment #3
dishabhadra commentedApplied the patch for datetime and datetime_range module.
Comment #5
mpdonadioThanks for this. There are a lot of out of scope changes in this patch. Make sure you only touch lines of code that replace t() with $this->t(), eg
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
Out of scope.
There are a bunch more. While these aren't necessarily wrong changes, we try to limit the scope of an issue to fix a single thing. This helps when we have to revert something, and when we have to rebase/reroll in-progress patches when patches get committed.
Edit, I would also poke through the issue queue to see if there is a general issue about doing this throughout core. I seem to recall one, but I am not sure.
Comment #6
dishabhadra commentedHi mpdonadio,
Thank you so much for reviewing my patch.
Yes as per your comments I will do the changes and submit the new patch.
Comment #7
dishabhadra commentedApplied the Patch with changes.
Comment #8
naveenvalechaOut of Scope.
Comment #10
yogeshmpawarI have rerolled the patch removing out of scope items.
Comment #11
naveenvalechaprobably not a bug report :)
Comment #13
mpdonadioMy suspicion is most of the fails are caused around here. If you look at the test results, there are a lot of "PHP Fatal error: Using $this when not in object context". This is a static function, so you can't use $this here. `static::t()` would be the proper thing to do, however, the only place in core where we use this is Views::getHandlerTypes(). From a quick look at other items (eg, BooleanItem), we use $this->t() in normal methods, but t() in static ones.
Comment #14
dishabhadra commentedAs per comments all the changes are made.
Comment #15
mpdonadioThanks, I will try to look at this tonight. When posting new work on an issue, adding a interdiff, so everyone can see both the new patch and what has changed since the last version. Here is the one between #10 and #14. Personally, I prefer the branch-per-patch method of working, so I use the git method.
Comment #16
wizonesolutionsComment #17
condor616 commentedI'm working on it at DrupalConEur Dublin Sprint
Comment #18
wizonesolutionsI am helping @condor616 with this issue as a mentor.
Comment #19
condor616 commentedIn the DateTimeDatelistWidget.php file, the function settingsForm() still contains t() instead of $this->t()
Comment #20
condor616 commentedI fixed the issues reported in #19. Please review
Comment #21
megachrizI helped @condor616 with this issue as a mentor as well.
Comment #22
megachrizComment #23
mpdonadioDoing some housekeeping here.
Replacing t() with $this->t() is the proper thing to do for the long term health of Drupal, but limiting this to just the datetime module isn't the right thing to do (see https://twitter.com/xjmdrupal/status/784386236370878465 and https://www.drupal.org/core/scope).
I don't know if there are long term plans to do this globally to the codebase as a mega-patch or a series of issues, but I am punting this over to the language system.
Comment #34
quietone commentedThanks to all who helped work on this. This has become outdated. It was fixed in #3181778: [w/c September 17th] Replace t() with $this->t() in all plugins.