Problem/Motivation
The patch being prepared in #2834889: Replace documentation and string references to drupal_render() was becoming unwieldy so it was decided that it should be split into smaller chunks.
Replace references to drupal_render() with RenderInterface::render() in @param, @return, @see, @link, etc. references.
Proposed resolution
grep -rn -B 5 -A 5 drupal_render core | grep -E '@link|@param|@return|@see'
Perform a grep in core/
folder for all drupal_render
string and display 5 or more lines before and after the match occurrence. Then perform grep again on the output of previous grep to filter @link|@param|@return|@see
.
grep -rn -B 5 -A 5 drupal_render core
will search for drupal_render inside core folder and will display 5 lines before and after the match occurence.grep -E '@link|@param|@return|@see'
will perform search on previous grep result and will grep all the @link|@param|@return|@see.
Update references as appropriate.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#15 | interdiff_7-12.txt | 1.49 KB | surbz |
#12 | 2938970-12.patch | 27.01 KB | surbz |
#9 | 2938970-9.patch | 27.01 KB | surbz |
#7 | interdiff-2-7.txt | 4.61 KB | MerryHamster |
#7 | 2938970-7.patch | 26.85 KB | MerryHamster |
Comments
Comment #2
MerryHamster CreditAttribution: MerryHamster at Skilld commentedThe beginning of the division of the big patch))
One moment is not clear for me: where (I mean issue) do we need to add changes to descriptions of functions?
Here or to another issue?
Comment #3
MerryHamster CreditAttribution: MerryHamster at Skilld commentedComment #4
msankhala CreditAttribution: msankhala as a volunteer and at Srijan | A Material+ Company commented@MerryHamster Thanks for the patch.
\Drupal\Core\Render\RendererInterface::render()
should be on the same line if line length does not exceed 80 characters. This same applies to all places.I think the changes in function description should be done in #2938969: Replace drupal_render() in docblock and comments outside of @param, @return, @link, @see and outside of @code - @endcode.
I think there are few more places with @param, @return, @see, @link which mention drupal_render. I have updated the issue summary to help you with this.
Comment #5
MerryHamster CreditAttribution: MerryHamster at Skilld commentedfixed #4 remark
Comment #6
MerryHamster CreditAttribution: MerryHamster at Skilld commentedComment #7
MerryHamster CreditAttribution: MerryHamster at Skilld commentedoh, I found some more plases with 'drupal_render' with @param, @return, @see, @link
thanks @msankhala for tip with grep
Comment #8
msankhala CreditAttribution: msankhala as a volunteer and at Srijan | A Material+ Company commented@MerryHamster its almost there.
line length in docblock should not be more than 80 characters.
I think you deleted the first line by mistake.
Comment #9
surbz CreditAttribution: surbz at Srijan | A Material+ Company commentedThanks @MerryHamster for this great patch, I was reading through and found that #7 covers most of it also the feedback mentioned in #8 was real quick and I have addressed these changes here.
Thanks @msankhala for reviewing this.
2938970-9.patch now contains changes requested in #8 and is ready for review.
Comment #10
surbz CreditAttribution: surbz at Srijan | A Material+ Company commentedComment #11
msankhala CreditAttribution: msankhala as a volunteer and at Srijan | A Material+ Company commentedThanks, @surbz for the updated patch. One small fix though. It has one trailing white space.
Comment #12
surbz CreditAttribution: surbz at Srijan | A Material+ Company commentedAaah! Thanks for noticing that.
Here is the updated one \m/
Comment #13
surbz CreditAttribution: surbz at Srijan | A Material+ Company commentedComment #14
andypost@surbz please add interdiff of changes you made, ref https://www.drupal.org/documentation/git/interdiff
Comment #15
surbz CreditAttribution: surbz at Srijan | A Material+ Company commentedAttaching the interdiff .
Comment #16
msankhala CreditAttribution: msankhala as a volunteer and at Srijan | A Material+ Company commentedPatch #12 applies cleanly and interdiff-7-12.txt looks fine. This patch removed all the
drupal_render
inside@param, @return, @see, @link
, etc. After applying this patchdrupal_render
are only left inside one line summaries or outside of@param, @return, @see, @link
that should be fixed in #2938969: Replace drupal_render() in docblock and comments outside of @param, @return, @link, @see and outside of @code - @endcodeAfter applying the patch I verified this with this command on mac.
grep -rn -B 5 -A 5 drupal_render core | grep -E '@link|@param|@return|@see' | awk -F'-' -v colon=':' '{print $1 colon $2}' | xargs subl
This command will open all the files in sublime where
drupal_render
is found. Then you can verify thatdrupal_render
is only left outside of@param, @return, @see, @link
. This command assumes that you have sublime added in your shellPATH
. Otherwise runln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
to add sublime in your path.Comment #26
alexpottAdding credit from the parent issue.
Comment #27
alexpottCrediting @msankhala for reviews on this issue.
Comment #28
alexpottBackported to 8.5.x as this is a docs patch.
Committed and pushed 3bfc5a384b to 8.6.x and e8157ca90a to 8.5.x. Thanks!