Closed (outdated)
Project:
Drupal core
Version:
9.5.x-dev
Component:
render system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2016 at 18:36 UTC
Updated:
24 Aug 2022 at 05:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
xjmComment #3
Yasiru Nilan commentedI'm new to drupal development, so I did a change as required in core/core.api.php file documentation.Please tell me is this correct before I proceed further
Comment #4
darrenwh commentedPatch #1 went over 80 char limit, rerolled.
Comment #5
oo0shiny commentedTested patch locally and was able to see the correct changes. Setting this to RTBC.
Comment #7
xjmThanks for the patch!
This patch needs to replace all the documentation references to
drupal_render(), not just one. There are lots more:So, let's go ahead and correct the others too. :)
Comment #8
tameeshb commentedComment #9
tameeshb commentedComment #10
manuel garcia commentedThank you @tameeshb for working on this.
Documentation lines must be under 80 characters, this happens throughout the patch.
https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...
Comment #11
tameeshb commentedRevised patch uploaded, please review. :)
Comment #12
manuel garcia commentedThanks @tameeshb! Some more coding standards nitpicks:
Trailing spaces on these lines need to be removed. There are a few others throughout the patch.
Comment #13
tameeshb commentedRemoved all trailing spaces in the comments.
Comment #14
manuel garcia commentedThanks! nearly there:
We make this line longer with the rest of the content that follows.
There needs to be a space after the asterisk.
We can make this line longer with the rest of the text that follows.
We can make this line longer with the rest of the text that follows.
We can make this line longer with the rest of the text that follows.
We can make these lines longer with the rest of the text that follows.
We can make this line longer with the rest of the text that follows.
Can we make this one line (there is space and it would read better).
Comment #15
tameeshb commented8/8 changes done. Please re-review!
Comment #16
tameeshb commentedComment #17
wturrell commentedFixes and partial review:
This is a tedious job (as I now appreciate!) so well done on completing it…
- Patch applies cleanly (8.3.x)
- I've read every change in the 40+ files and viewed them in PhpStorm
- I'm not seeing any coding style / inspection warnings etc.
- I've fixed a couple of occurrences that were missed
- Fixed some line length/indentation issues
NB: There's a small number of inline code comments in /core referring to drupal_render(), but which aren't next to an actual usage of it - I've left those, to stay in scope.
Documentation rather than code, so:
- can't see this would create any regressions
- no translatable string changes
Someone will now need to check my changes then hopefully we can get this into 8.3.
Also we need to wait for the automated tests to run once the branch has been fixed.
Comment #18
wturrell commentedComment #19
manuel garcia commentedBrilliant, thank you @tameeshb & @wturrell
I've reviewed the interdiffs on #15 & #17, and they look good to me.
Comment #20
tameeshb commented:)
Comment #21
manuel garcia commentedPatch came back green =)
Comment #22
alexpottHere's the start of a review... a couple of general points... we need to point to
\Drupal\Core\Render\RendererInterface::render()in the @see's so api.d.o can link up the docs. Also when referring to the array structure expected by::render()we should also point to the interface. When we are talking about an implementation detail then pointing to\Drupal::service('renderer')->render()or\Drupal\Core\Render\Renderer::render()is appropriate. Another useful thing to link to is https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21... - you can do that in docs with@link theme_render Render API @endlink.Unfortunately this task is not a simple string replace.
This should be an @see to \Drupal\Core\Render\RendererInterface::render
as expected by \Drupal\Core\Render\RendererInterface::render().
See @see comment before.
See @see comment...
This should be on one line... going to be tricky.
Again...
Comment #23
ritzz commentedCould not fit this in one line. Any way to do it?
Comment #24
manuel garcia commentedno need for 'to'
no need for 'to'
no need for 'to'
no need for 'to'
Should be 'An array as expected by \Drupal\Core\Render\RendererInterface::render()'
Should be 'An array as expected by \Drupal\Core\Render\RendererInterface::render()'
Comment #25
tameeshb commentedMade changes from #24
Comment #26
ritzz commentedComment #27
boaloysius commentedpatch reroll
Comment #28
boaloysius commentedComment #29
zeip commentedRe-rolling the patch again for 8.3.x. Also replaced mentions in core/tests/Drupal/Tests/EntityViewTrait.php, core/core.api.php and core/modules/path/src/Controller/PathController.php.
Comment #30
zeip commentedComment #31
zeip commentedAttached is a patch with a few more string replaces. Now all drupal_render() instances are replaced by either this or #2704871: Replace usages of deprecated method drupal_render(). Should be finally read for the review.
Comment #32
jofitzMinor coding standards corrections to @see.
Comment #33
vegantriathletesee if you can get it to RTBC
Comment #34
crossfish commentedRan on SimplyTest.me and applied patch #32 to local dev environment and all modifications to comments did not cause any problems. Reviewed comments and code changes and proper Drupal standards were applied.
Comment #35
crossfish commentedComment #36
manuel garcia commentedThank you crossfish for testing!
Pushing this back - we need to first adjust these comment blocks:
Can we fill up to the end of the line please
Same
Comment #37
vegantriathleteComment #38
jofitzCorrected line-breaks in comments as highlighted in #36.
Comment #39
manuel garcia commentedThanks! Tempted to to RTBC again, but going back to @alexpott's review on #22, I had a look at the patch trying to identify where we should point to the interface instead. Here are some places that could be useful to do so at a first glance:
Should we be pointing to
\Drupal\Core\Render\RendererInterface::render()here instead?Comment #41
zeip commentedThanks for the review! Attached is a new patch changing those and a few other instances of the service reference to the interface. I changed most of the return value descriptions (the ones not containing any additional information) to all conform to the same one-row format.
Would this be ok or are we still missing something?
Comment #42
manuel garcia commentedThanks @ZeiP for that!
Had a quick look at the interdiff:
We should not be referring to
drupal_render()here.Comment #43
zeip commentedThanks! We aren't, the patch itself doesn't contain those rows but for some reason the interdiff has a few incorrect lines. I don't know why, since most of the interdiff lines are correct and I generated it with the patchutils interdiff as usual.
Setting back to Needs review.
Comment #44
manuel garcia commentedOw OK, yup, you're right those changes are not in the patch.
I had another read at all the things, and I believe we are ready for committer review again... so RTBCing =)
Comment #45
xjmSo a couple things:
drupal_render()itself and not make other changes other than rewrapping; rewriting comments makes the word diff no longer as useful and requires a different review scope because then you have to read the whole comment and make sure it's still true and grammatically correct.we shouldn't refer to the
\Drupal::service()convenience wrapper. Or, in other words, we should probably only refer to\Drupal::service('renderer')if we're in a procedural context. I especially don't think we should be referring to it within the Render component itself. Those should refer to the interface method instead, most likely..
Based on the above, I think we can split this up into a small number of sub-issues:
drupal_render(), since unlike most things these aren't going to work as straight string-replaces. They probably shouldn't refer to it anyway; it's an implementation detail. Usually, "during rendering" or such is probably an acceptable substitution in one-line summaries.Thanks!
Comment #47
jofitzCreated child issues:
Postponing this ticket until all 4 have been completed at which point we can:
Comment #48
alexpottAdding credit to make copying to the sub issues easier. Crediting @xjm, @Manuel Garcia and myself for reviews that directly influenced the patch.
Comment #50
avpadernoComment #51
avpadernoComment #57
quietone commentedSearched core and there is only one instance of 'drupal_render'.
I then found that the use of that function was removed in #2378883: Convert existing drupal_render() KernelTestBase tests to PHPUnit tests. It appears to be dead code. I made an issue for that #3305648: Remove common_test_drupal_render_printing_pre_render
So, this can be closed as outdated.
Thanks everyone!