Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
user.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2015 at 17:08 UTC
Updated:
10 Feb 2017 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
xxronis commentedWorking on this one in DrupalCon sprint
Comment #3
xxronis commentedComment #4
xxronis commentedApplied patch core/modules/user/user.api.php cleanly
Comment #5
xxronis commentedComment #7
ndobromirov commentedHi,
The issue's patch in #4 applies to the latest D8 cleanly.
It's just a docks change so there are no functional regressions in it.
It confirms to the requirements in the task and D8 coding standards.
Question:
Is this documentation task only related to the hook_... documentation declaration in the .api file or it should update all the places where it is be-ing used or referenced, for example:
- user_hooks_test_user_format_name_alter
- AccountInterface::getDisplayName
BR,
Nikolay Dobromirov.
Comment #8
xxronis commentedHi, I think we only got to do the .api file, the doc on AccountInterface::getAccountName looks OK.
Would it be better to have the exact same description on AccountInterface::getAccountName?
thanks
Comment #10
subhojit777Thanks @xxronis for working on this. Just some small nitpicks :)
The other case (trusted HTML content) can be separated from the former case with punctuation full stop. Also consider it putting it in next line.
s/needs to be/should be
Comment #11
subhojit777Comment #12
a_thakur commentedI see another issue which says Remove hook_user_format_name_alter() https://www.drupal.org/node/2575213. So does it make sense to put effort here?
Comment #13
subhojit777Interesting. I am posting in #2575213: Deprecate hook_user_format_name_alter() regarding this issue.
Comment #14
xxronis commentedAlso changing to Drupal\Component\Render\MarkupInterface following commit #708ce0a
Comment #17
subhojit777Comment #18
mile23At this point, this should be a documentation-only patch for 8.0.x, and #2575213: Deprecate hook_user_format_name_alter() should be considered for 8.1.x since it's an API change.
Comment #21
quietone commentedIssue still relevant and needs a reroll.
Comment #22
Lal_Comment #23
Lal_I've uploaded the re rolled patch
Comment #24
quietone commentedWelcome AbhishekLal! Thanks for rerolling the patch.
The patch looks good, but there are some extra lines in it.
These need to be removed.
And, if you haven't already found it there is a handbook page for rerolling patches. Heaps of useful info in those handbook pages.
Comment #25
gianani commentedAdding a new patch.
Changed:
-The string that $account->getDisplayName() will return.
-Implementations are allowed to change it to either.
+Either a string that $account->getDisplayName() will return or a MarkupInterface object.
Comment #26
joyceg commented@gianani,
Thanks for the patch. It is getting applied properly.
Comment #27
amit.drupal commentedUpdate #25 patch.I hope its helpful.
Please Review .
Comment #28
quietone commentedThanks all, almost there.
The coding standards state that "Sentences should be separated by single spaces." So, this needs to be changed to replace the new lines with spaces and to adjust so it is still within 80 characters length.
Not sure why this is added. user_format_name isn't used in this method.
Comment #29
Lal_Comment #30
quietone commented@AbhishekLal, still a bit more. When making a patch please iinclude an interdiff, they do make reviews easier.
Why are these lines added to the patch?
Good, the newlines have been replaced. Just need this to be adjusted to that it doesn't exceed the 80 character column limit. What I meant to say was to move the new lines so that the sentences are separated by a single space and each line is no more than 80 characters long.
Comment #31
Lal_Comment #32
Lal_Comment #33
quietone commentedThanks for the interdiff.
Delete this blank line, there are no blank lines betwee @param tag lines.
Delete these two lines. $account is declared below.
These two lines are part of the description of $name. They need to move after that and be adjusted to be < 80 characters per line and indented the same.
@AbhishekLal, I don't know if you are using an IDE to edit these or not. But it will be worth exploring the settings to get a visual indicator for where column 80 is.
Comment #34
hardikpandya commentedComment #35
quietone commented@hardik.p, thx for working on this.
This correctly makes a paragraph. But the new line after 'return.' should be replaced with a space and then followed by the sentence starting with 'Implementations. And then each line adjusted for the 80 character limit. I hope that makes sense. If not, just ask.
Extra space at end of line
Comment #36
Lal_Comment #38
quietone commentedHey, thanks for continuing to work on this. Still some indentation issues.
If you haven't already seen them the handbook has lots of information on the coding standards and there is a section just for the @param: Function parameters.
Delete trailing space at end of line.
Indent 'allowed' 2 spaces and delete space at end of line. Note that the line will be > 80 characters after the change.
Indentation incorrect.
Comment #39
ritzz commentedComment #40
hardikpandya commentedComment #41
quietone commentedAwesome, indented and within 80 characters. Without that distracting me I can read the text and see it does not flow well. Should have done that earlier, sorry folks. (I'm working on improving my review skills). But one more change.
'Implementation are allowed to change it to either' doesn't sound right. To either what? How about:
The value that @account->getDisplayName will return. If it is a string it will be auto-escaped. If it is a MarkupInterface object it is HTML escaped. Either is safe to be printed within HTML fragments.
Comment #42
ritzz commentedComment #44
ada hernandez commentedComment #45
vanessakovalsky commentedLast patch seem ok to be commit
Comment #46
alexpottHmmm... so this parameter is dual purpose. I think we should say that this is the value being altered. Or well take a completely different approach and don't mention the implementation so explicitly in the documentation. Also the documentation about escaping is not clear. If the method changes the output to be a MarkupInterface object it is the responsibility of the implementation to ensure that it is safe. If something is a MarkupInterface object it will not be auto-escaped by Twig so this is important. So something like:
Also we can an add
@see sanitizationComment #47
dimaro commentedPatch to apply the suggested changes on #46.
Comment #48
dimaro commentedUps! I forget attaching the patch.
Comment #49
ada hernandez commentedComment #50
alexpottSomething seems duplicated here.
Comment #51
ada hernandez commentedok, reviewing
Comment #52
ada hernandez commentedComment #53
quietone commentedGreat, the issues in #46 are fixed.
Comment #54
alexpottCommitted and pushed 63cad2c to 8.3.x and a3b15c9 to 8.2.x. Thanks!