Problem/Motivation
Currently usernames as links are trimmed when over 20, to 15 + 3 periods.
Proposed resolution
Trim when over 30, to 29 + an ellipsis character. Use a constant for trimming length as suggested in #93 and fix other mentioned issues.
Remaining tasks
#111 Do we need any theming (for mobile)?
#161 In #120, the $variables['trim_length'] was added. Verify that this works. Is there actually a way for a theme (such as the Seven theme) to set this variable? Answered in comment #226.
User interface changes
Longer usernames, see screenshots.
Beta phase evaluation
| Issue category | Task because there is no functional bug, only an update to existing functionality. |
|---|---|
| Issue priority | Minor |
| Unfrozen changes | Not Frozen because it changes markup and automated tests only. |
| Prioritized changes | The main goal of this issue is usability. |
Additional Explanation
A whole lot of board posts, questions and articles out on the web are calling for usernames not getting truncated to 15 characters when displayed as links, for example in node view:
- https://drupal.org/node/82672
- https://drupal.org/node/80953
- https://drupal.org/node/85476
- https://drupal.org/node/810938
- http://drupal.stackexchange.com/questions/54054
- http://data.agaric.com/stop-drupal-from-shortening-long-usernames
- http://sscnet.ch/content/keep-drupal-truncating-user-names
- http://grokbase.com/p/drupal/support/07667d4acm/long-username-getting-tr...
- ...
While some limit might be necessary to avoid extremely (!) long usernames breaking the layout, 21 or 25 or even 30 characters are perfectly right and quite usual, especially if a full name or email address is provided.
We don't want to make configurable whatever can be overridden by code, but at least we want to provide a diligent default that makes overriding the exception rather than the regular case.
Therefore I'd propose to raise or waive the limit given in theme_preprocess_username().
Screenshots after applying patch in #91
Long Usernames MOBILE BEFORE

Long Usernames MOBILE AFTER

Long Usernames DESKTOP BEFORE

Long Usernames DESKTOP AFTER

| Comment | File | Size | Author |
|---|---|---|---|
| #250 | 2266991-after_patch.jpg | 40.97 KB | gaurav-mathur |
| #250 | 2266991-before_patch.jpg | 37.42 KB | gaurav-mathur |
| #246 | 2266991_216-246.patch | 1.58 KB | manojkumar_97 |
| #241 | MoreThan31.png | 32.69 KB | asha nair |
| #240 | afterPatch.png | 35.32 KB | asha nair |
Issue fork drupal-2266991
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:
Comments
Comment #1
panchoAttached patch raises the limit to 30 characters and uses an ellipsis instead of three periods.
Comment #2
dawehnerI guess we need some basic testcoverage to know that truncating works as expected. Btw. you could directly replace it with Unicode::strlen() already.
Comment #3
dman commentedComment #4
pwolanin commentedComment #5
oskar_calvo commentedI have tested the patch from #1, and it seems to works fine in nodes author, and in "Who's new" blocks, and it works fine.
Comment #6
dman commented@oskar_calvo : "Needs tests" is not just looking for "Works OK for me today".
It is "We need automated unit tests added to core code that prove that this change performs as needed, and can be reliably re-tested automatically for every single change that happens in the future"
That's the difference between "Needs (automated) Tests" and "Needs (some) Testing/verification". The difference between these two type of testing is sort of a big deal.
It would be cool if you got involved with coding tests to the point where you could *prove* the fix works, and not just offer anecdotal support. It's a big step, I know.
Confirming that "It works for me" is also really helpful input and does help move things forward, so thanks for that! - it counts, and encourages folk who want to do unit-testing that this is worthwhile.
Comment #7
ducktape commentedI have added some tests for the username. Node author, comment author and the "who's new" block gets checked if the full username is present or not.
Comment #8
wim leersThanks!
I've got mostly nitpicks, but I think there's also a subtle flaw in the current solution — an additional precise test for the expected truncated username would've picked that up, so it might be worthwhile adding an assertion like
$this->assertText('<my really long user name cut off to 29 characters>…').s/Definition of Drupal/Contains \Drupal/
Is it necessary to use the
standardprofile? It's preferable to not use that, because it's significantly slower than thetestingprofile.Missing comma after "functionality".
Let's use consistent descriptions here.
Missing newline — we always ensure there is one newline before and after a method.
This uses the ellipsis character (
…) rather than three periods (...) — great! :)But… doesn't that mean the substring of the 29 first characters should be taken, rather that of the first 27 characters?
Comment #10
ducktape commentedGood point there, Wim. I changed the truncating logic to "29 plus the ellipsis". I also fixed the remarks in the test and switched to the testing profile. It's a lot faster now indeed, thanks!
Comment #12
gnuget10: longer_username.2266991-10.patch queued for re-testing.
Comment #13
wim leers#10: could you provide an interdiff next time? :)
Just a few more nitpicks, then I'll be able to RTBC this:
Missing docblocks.
{@inheritdoc}Comment #14
martin107 commentedFixed issues from #13.. hope this helps
Comment #15
joshua.boltz commented#14 patch seems to have fixed the issue with the character cut-off change to 29+ellipsis of the user name.
I've verified it working on node list view and node view.
Comment #16
gnugetI did a quick review of this patch and i just find one coding standard nitpick:
The last element of this array needs a comma at the end.
For everything else, looks good to me.
Comment #17
alexpottNeeds a reroll
Comment #18
lokapujyaReroll. Note the switch from drupal_substr to Unicode::truncate().
Comment #19
lokapujyaAdded the missing comma.
Comment #20
rick hood commentedVerified output for node author seems to be 28 characters +ellipsis
Also 28 characters +ellipsis on comment form and who's new.
Comment #21
keopxResult
<span class="field field-node--uid field-name-uid field-type-entity-reference field-label-hidden" data-quickedit-field-id="node/2/uid/es/full"><span lang="" about="/user/4" typeof="schema:Person" property="schema:name" datatype="" content="no012345678901234567890123456789si">no01234567890123456789012345…</span></span>Comment #22
catchlonger short username?
Comment #23
sharique commentedUpdated patch.
Comment #24
star-szrThank you @Sharique, here's the missing interdiff.
getInfo() is gone, please see https://www.drupal.org/node/2301125.
Assertion messages usually are complete sentences (add a period to the end). I would also suggest that removing the word "is" from all these might be an improvement.
Comment #25
star-szrForgot the attachment.
Comment #26
pgautam commentedIncorporated #24 in this patch. Please review this patch.
Comment #27
star-szr@pgautam - interdiff please!
Comment #28
pgautam commented@Cottser, sorry for that. here is updated patch with interdiff file.
Comment #29
star-szrNo need to apologize @pgautam just to good to get in the habit :) I cancelled testing on the first patch.
At a glance the changes look good. Thank you!
Comment #31
legolasboI've reviewed the patch(es) and found that #26 and #28 were both missing changes. I've created a new patch combining #26 and #28.
Comment #32
thijsvdanker commentedThe UserUsernameTest.php file is placed in the core/modules/user/lib/Drupal/user/Tests directory, but should be in the core/modules/user/src/Tests directory.
I'm working on a reroll.
Comment #33
thijsvdanker commentedRerolled with the test in core/modules/user/src/Tests.
Comment #34
esod commentedThe patch applies cleanly and the use case works. It's good for me to know that UserUsernameTest.php should be in core/modules/user/src/Tests although others should confirm.
Comment #36
legolasboI'll have a look at the failing test
Comment #37
legolasboThe tests failed because they had several errors which I've fixed and tested thoroughly.
Comment #38
mradcliffeIs this standard practice to depend on the container in tests? Can we make the node commentable in another way?
If this is the only method of creating fields quickly in tests, then OK.
Comment #39
mradcliffeIt looks like core does this a lot in tests.
Maybe add some screen shots and update the issue summary.
Comment #40
keopxWorking in this issue.
Need reroll
Comment #41
keopxRe-roll
Comment #47
mradcliffeHere's some failing tests to look at locally to debug why they're crashing. There are more fails than those listed in the review log section, but these aren't making it through their entire test. Most of those tests are in Comment and Search modules. Try running a test like CommentTitleTest locally.
Unicode::strlen() should still be used here, not drupal_strlen().
Comment #48
keopxreroll.
Thanks @mradcliffe for review :)
Comment #49
diego21 commentedIt works for me.
Comment #50
alexpottI would have expected some screenshots of the admin/people screen and other pages with user names displayed, eg. comments, nodes and user pages.
Comment #51
keopxHi, thanks for review.
Here screenshot. I think with this is correct.
Info:
Comment #52
diego21 commentedGood stuff, thanks @keopx
Comment #53
diego21 commentedSorry, I think there is something wrong with that screeshots
Comment #54
keopxHere correct screenshot, sorry with confusion :-$
Sorry @diego21
Comment #55
diego21 commentedIt's ok @keopx, changed state to RTBC
Thanks!
Comment #56
alexpottThis issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary.
Also the title needs fixing because we are not displaying the full username.
Comment #57
lokapujya.
Comment #58
lokapujyaNeeds a newline at end of file.
Comment #59
lokapujyaComment #60
keopxcorrect mistake
Comment #61
lokapujyaComment #62
lokapujyaComment #63
lokapujyaComment #66
mradcliffeComment #67
lokapujyaSee https://www.drupal.org/node/2411239
Comment #68
sumitmadan commentedRerolled the patch with test failure fixes. Hope this will work. :)
Comment #69
sumitmadan commentedComment #70
sharique commentedIt is added already, so no need to add it again.
Comment #71
sumitmadan commentedDrupal is using php's trait strategy. Check out #2134513: [policy, no patch] Trait strategy.
We need to add
use Traitto make it working. Working without this cause test to fail.Comment #72
sharique commentedI mean CommentTestTrait is used in "Use" statement is used twice. Please remove second one.
Comment #73
sharique commentedOh, so this is how traits works.
Comment #74
lokapujyaOptional: Should we go with the shorthand array syntax? Here and other places in the patch.
Also, I have unfrozen this issue.
Comment #75
keopx@lokapujya I do not understand your comment, I see other test and use this same line.
Works fine for me.
Comment #77
keopxHere reroll with changed method .
Old: String::checkPlain
New: SafeMarkup::checkPlain
Changed to support new reserved php class names.
Comment #78
sumitmadan commentedComment #79
keopxHere reroll with changed method .
Old: String::checkPlain
New: SafeMarkup::checkPlain
Changed to support new reserved php class names.
PS: sorry, because I forget some lines
Comment #84
keopxI do not but in local enviroment test works :-/
Comment #86
sumitmadan commented#79 Patch worked fine for me but seems patch was failing because of interdiff.
Changed patch and interdiff according to #68. Lets give it a try.
Comment #88
rteijeiro commentedFixed a missing period. I can confirm that tests pass in local so let's see what's wrong with testbot.
Comment #90
zaporylieI just tried to test it on my local machine and it returns fails (just like testbot):
I will look at it.
Comment #91
zaporylieLet's try it again, this time without block cache.
Comment #92
rteijeiro commentedIf it's green, then it's RTBC for me.
Long Username BEFORE
Long Username AFTER
Comment #93
xjmThanks for the beta evaluation, test coverage, manual testing, and screenshots! I'd consider this a task -- it is altering an existing bit of functionality, not adding a new one. I think it makes sense to increase this default length as 15 is so short as to be a bit unfriendly. I've had to override this on sites before.
So even if we choose not to make this default truncation length a constant or configurable, can we at least add a comment in the test that explains where this magic integer is set? (That is, the preprocess implementation.)
These assertion texts are very confusing. "Untruncated username found" is asserted immedidately after "untruncated username not found"! In the code it's clear that it's two different names.
I think it'd actually be better to remove the assertion message texts from all the similar assertions in this new test class.
assertText()has a default assertion message that provides more helpful and specific information for debugging than this. In this case the assertion texts are hiding information.I considered whether this should be a constant or something configurable rather than a magic integer, but since this is a preprocess anyway and can be overridden as desired, that's probably not necessary. The comment above this hunk also documents that it's the specific preprocess's responsibility to truncate safely to the desired length.
However, the 30 and 29 do seem a bit arbitrary. Would it be clearer to have a variable for the length, and truncate to length - 1?
Also, I think the previous 15 vs. 20 was to leave room for the characters of the ellipsis. So now a 31-character username will have its length increased to 32. No? Let's at least document the lengths chosen.
My only other concern is that this might be very wide in existing tables where the user name is a high priority field, for example the user admin view. Can we get additional screenshots of long, truncated usernames in that view, both at a desktop width and a mobile width? Embed the screenshots as @rteijeiro has or (even better!) in the issue summary. (Also the summary looks a bit out of date.)
Thanks!
Comment #94
rteijeiro commentedComment #95
rteijeiro commentedComment #96
keopxComment #97
rteijeiro commentedComment #98
rteijeiro commentedComment #99
rteijeiro commentedComment #100
keopxThanks
Kudos for @xjm and @rteijeiro
Comment #101
rteijeiro commentedThis change looks wrong.
Please, document the constant. For example:
Trimming length for long usernames.Comment #103
keopxComment #105
lokapujyaShouldn't USERNAME_TRIMM_LENGTH be with just one M?
Comment #106
lokapujyaUSERNAME_TRIMM_LENGTH-1 is to include the ellipsis character (which used to be 3 periods.
Comment #107
keopxComment #108
dimaro commentedComment #109
dimaro commentedUpdate comments.
Comment #110
keopxLooks good.
Comment #111
xjmThanks @rteijeiro for the awesome screenshots :D But the reason I specified the user admin view is this:
So based on the fact that we're breaking an existing UI a little with this change, I think this needs more discussion.
I also discussed the class constant with @amateescu and @dawehner. Rather than adding a global constant, they suggested adding as a variable in
user_theme(). Then I think it would be easier for themes to override it and still get the proper truncation, but that also gives us a place to document the quantity.Comment #112
keopxComment #113
joelpittetMoving to get this tackled in 8.1.x version since we are in RC.
Comment #114
lokapujyaneeds a reroll + see #111 (about moving the constant to a variable in user_theme().
Comment #115
kostyashupenkoPatch from #109 re-rolled
Comment #117
xjmLooks like the novice tag was added back in 2014, when core was in a different state. Since there isn't a clear novice task on this issue per https://www.drupal.org/core-mentoring/novice-tasks, I am removing the novice tag.
Comment #118
lokapujyaFirst 2 test fails: user_format_name_alter() doesn't get called anymore because the of this change:
getDisplayName invokes the hooks, but getUserName does not.
The test is relying on the alter hook to run and change the name to an ID.
Comment #119
lokapujyaSo, we aren't really done with the reroll.
Comment #120
sivaji_ganesh_jojodae commentedPatch re-rolled and used variables to allow themer to overriding.
Comment #123
th_tushar commentedComment #124
dman commentedThese tests have been failing is what seems to be an unrelated area
This has been happening on our local dev environments, and Now I am seeing it in the testbot report too.
I can't see what the connection is between "ConfigSchemaChecker" and what we are testing here.
Comment #125
mohit_aghera commentedChanging string validation in patch based on testbot output.
Comment #126
mohit_aghera commentedSomething is wrong with interdiff. @th_tushar please work as mentioned by @dman
Comment #128
dimaro commented@sivaji@knackforge.com
You can create an interdiff correctly following the steps in this url:
https://www.drupal.org/documentation/git/interdiff
I hope you find it useful.
Comment #129
th_tushar commentedHey,
The issue will be fixed with the updated patch. Changing the status of the issue to "Needs Review".
Thanks,
th_tushar
Comment #131
lokapujyaCould you please add an interdiff?
Comment #132
lokapujyaComment #133
th_tushar commentedHey,
Reviewed the interdiff file in #132, its fine. Its solves the issues with the submitted patch in #129.
Changing the issue status to "Need Review".
Thanks,
Comment #134
lokapujyaReverse the change made in the reroll described in #118.
Remove some changes that seem unnecessary.
Comment #135
th_tushar commentedThe new patch that fixes all the issues.
Comment #136
lokapujya@th_tushar the interdiff in #132 IS the interdiff between #125 and #129. It shows the changes that you made. You should provide an interdiff with each patch that you upload so that we can see the changes between patches.
Comment #137
gnugetIs there a reason why are we commenting these lines instead of deleting them?
And Yes, we need a new interdiff for every new patch.
Comment #138
th_tushar commentedHi All,
I have removed the commented code and added the interdiff.txt file in comparison to patch added in #125. The attached patch fixes all the issue.
Thanks,
th_tushar
Comment #139
harshil.maradiya commentedYes, patch is working as expected
Comment #140
kshama_deshmukh commentedI reviewed the patch and its working as expected.
Comment #141
lokapujyaWe should not be changing these tests.
Why is this being changed to a viewstest?
why changing the string sizes? Why using machine name (it's a user name not a machine name)?
Why removing the isSafe() if the assert text says "marked safe"?
I have fixed all these issues in the #134 patch.
Comment #142
gnuget#141 looks great!
Thanks!
Just one very small nitpick.
Let's remove one empty line here.
Also, all the new patches to I've reviewed lately use the new short array syntax in new functions and methods, can we use that syntax here as well?
Comment #143
lokapujyaComment #144
lokapujyaalso removed some deprecated safemarkup calls.
Comment #145
gnugetSome final nits:
Those assertTrue are repeated, even if they are in different methods the $this->userLongName is defined in the setup, so I think we can remove one.
There is a missing space after the "=" operator in the array.
I think the @see statements no need the period in the end.
Can we update the description of the issue? I think the "remaining task" is outdated.
This looks great! Thanks!
Comment #146
lokapujya1.) Looks like those assertTrue()'s should be assertText()s.
Comment #147
lokapujyaComment #148
lokapujyaThe assertTexts might fail.
Comment #149
lokapujyaComment #151
gnugetGreat work!
Comment #152
droplet commentedShouldn't it be more smarter to trim username without SPACE only ?
Comment #153
lokapujya@droplet: can you elaborate on #152? I don't completely get it. Are you suggesting we trim whitespace after trimming the length?
We can't ignore #111 either. The theme may need an update to keep edit buttons visible on mobile?
Comment #154
gnuget@droplet I'm not sure if that would be smarter, even if the username has an space it could be something like:
"this isasuperlongusernamewithanspace"
Even with an space this username would need to be trimmed.
Comment #155
lokapujyaBut what if the space is the last character after trimming? That could be a separate issue though (if that's what he meant.)
"this ..." vs.
"this..."
Comment #156
lokapujyaComment #157
droplet commented@gnuget,
ahh, you right :)
Comment #159
hugronaphor commentedThe case of "this ..." will not happen because
Unicode::PREG_CLASS_WORD_BOUNDARYis used while detecting the stripped string.@see: https://github.com/drupal/drupal/blame/8.1.x/core/lib/Drupal/Component/U...
Comment #160
gnugetThis is good to know!
Thanks!
It seems to the testbot fail for an unknown reason, I will test it again just to be sure if something is wrong.
Comment #161
lokapujyaSo, the remaining task is to make the operation links visible in mobile, see comment #111. How do we do this?
In #120, the $variables['trim_length'] was added. Is there actually a way for a theme (such as the Seven theme) to set this variable?
Comment #163
lokapujyaComment #164
nesta_ commentedTry to fix the remaining task on #161, where says that we have to look on #111.
Before:

After:

Comment #165
keopxComment #167
gnugetI looked at the code if there are other places where the CSS is just for a specific form action and I haven't found anything.
So maybe this is not a good approach to fixing this?
Comment #168
nesta_ commentedwhy not @gnuget?
This only happens in this case, you will never change the route and is the best solution that can be given from the visuals no other functionality of other modules and pages undergo this modification.
Comment #169
lokapujyaA more common way might be to target the ID of the form (for one off CSS)?
Comment #170
lokapujyaThe action is not guaranteed to be the same. For example, would it change in another language? What if an alias is used? etc..
Comment #171
gnugetAccording to our guidelines:
So, I think we are here modifying a component based in context AND relying on HTML structure, so yes definitely this is not the correct approach.
You can read more about this here: https://www.drupal.org/coding-standards/css/architecture
Comment #172
nesta_ commentedThank you @gnuget & @lokapujya. What is the next step you want me to do?
Remove "action" attribute in css file?
Comment #173
lokapujya@nesta_ You can implement how ever you think is best and we will review. I think the CSS needs a class or a form ID selector.
What happens when NOT in mobile view. A new patch should maybe have a screenshot of both mobile and non mobile. I would have to know more about Bartik to give you a better answer. It possibly needs a media query (if it's not already in one, can't tell from the patch)?
Separately, we still have to answer the 2nd question in #161.
Comment #175
dimaro commentedAdd test against 8.3.x on #164.
Comment #177
nesta_ commentedComment #178
lokapujyaComment #179
lokapujyaComment #180
lokapujyaUpdating Remaining tasks.
Comment #181
lokapujyaNeed to answer #161. maybe have a test for it, because i'm not sure it works or remove it.
Comment #182
dimaro commentedThe latest patch no longer applies.
Tagging this issue.
Comment #183
jofitzRe-rolled.
Comment #184
gnugetAccord with this, any new test must use the new base classes (BrowserTestBase) and here we are still using WebTestBase.
It is necessary to migrate it.
Comment #185
jofitzGood spot, @gnuget! BlindReRoll-- :)
Comment #187
amit.drupal commentedTest patch #164 on drupal 8.4.x-dev. and its working fine.
Comment #188
amit.drupal commentedSorry, I Forgot Mobile Attachment.
Comment #189
gnugetHi amit.drupal
Thanks for your manual tests.
But before to continue testing this we need to make sure that all the tests are passing, on #185 there are 2 failing tests, also we still need to answer #161 also per #167 this needs a different approach.
Thanks!
Comment #190
lokapujyaFix the failing tests.
Comment #191
lokapujyaNeeds Tests for the change in #120. Or, steps to do a manual test of #120 might be helpful.
Comment #194
lokapujyaComment #195
lokapujyaComment #201
bohus ulrychHi, this looks promising. Would it be possible to create patch for recent Drupal 8/9 versions?
Thanks
Comment #202
ajv009 commentedComment #203
ajv009 commentedPorting to 9.2.x
Comment #204
ajv009 commentedComment #205
ajv009 commentedComment #207
kuldeep_mehra27 commentedComment #208
kuldeep_mehra27 commentedComment #209
kuldeep_mehra27 commentedComment #210
kuldeep_mehra27 commentedComment #212
kuldeep_mehra27 commentedComment #214
ravi.shankar commentedFixed failed tests of patch #212.
Comment #215
lokapujyaWe are getting usernames that are creating invalid email addresses. I changed to randomMachineName() and it passed.
Previously, the content showed up on the homepage and this worked. Might get around this by calling $this->drupalGet('node/1'); after login (or we could set the content to show up on front page for this test.)
USERNAME_TRIM_LENGTH - 3should pass. Something changed. The username is a link. Maybe the single character … got replaced with ... and it got trimmed a couple characters?Comment #216
kuldeep_mehra27 commentedComment #217
ravi.shankar commented@kuldeep_mehra27 can you please add interdiff as well.
Comment #218
kapilv commentedComment #219
kapilv commentedComment #220
vikashsoni commentedThere is no issue like text lapping when username is length above 25 and 30 sharing screenshot ...
Comment #221
sulfikar_s commentedI've applied the patch and I think it needs work. Though the screen doesn't get flows off the mobile screen, the 'edit' button overlaps the 'roles' for small screen devices.
I'm attaching the screenshots below.
Before,

After,

Changing back to Needs Work!
Comment #222
bohus ulrychHi,
patch can by now applied without any problem. But I don't know where and how to overwrite default 30 characters length value.
Thanks
Comment #223
lokapujyaAdmin theme can trim it to the current length.
See change in comment #120. Maybe, we want to trim it to current length in user_theme so that it works the way it does now. Then other themes can use the full length?
Comment #224
bohus ulrychThanks @lokapujya but this is exactly where I need help.
I should be able to overwrite default value using $variables['trim_length'], but where?
In my admin theme (subtheme of seven) I was trying to change in in template_preprocess_username(). Function was triggered, $variables['trim_length'] was set, but it didn't worked.
Or do it using user_theme()? How, where - in the theme?
Thanks
Comment #225
lokapujyaIf you are calling theme_user(), you can pass the variable. But, I don't see anyplace that actually calls
theme('user', [variables])to point us to an example. Maybe, the theme could implement username.html.twig and could use the untruncatedname_rawand then the theme can truncate it however it wants to? Hopefully, someone that knows theming really well can explain better.Comment #226
bohus ulrychThanks for help. Finally it is working.
1) apply patch
2) custom function themename_theme() in the themename.theme file
3) file templates/username.html.twig must exist
Then it seems to be working as expected. Don't know if this approach is best way - doesn't sound too much intuitive. But it is working, good starting point.
My 2 cents: const USERNAME_TRIM_LENGTH and Unicode::truncate($name, $variables['trim_length'] - 1, FALSE, TRUE) should follow current default Drupal's behavior, not to overwrite it with something else. IMHO this will cause troubles to all lot of people.
Comment #227
lokapujyaComment #228
lokapujyaComment #229
lokapujyaComment #230
bhumikavarshney commentedPatch #216 works fine for me and no overlap issue is there.
Thanks
Comment #231
Poojita0802 commentedComment #232
Poojita0802 commentedComment #234
rinku jacob 13 commentedVerified and tested patch#216 for drupal 9.3.x-dev version. Patch applied successfully and looks good to me.Adding screenshot for the reference.
Comment #235
bohus ulrychFYI patch#216 successfully applied with Drupal 9.2.8 and seems to be working well.
Comment #237
devashish jangid commented#216 Patch is working fine and shared the screenshot for the reference.
Comment #238
quietone commentedThanks to everyone for moving this along.
The issue summary needs to be updated. The screenshots in the IS are from the patch in #91. Instead they should always be from the latest patch. Having an up to date Issue summary helps the reviewer. Adding tag for an IS update.
The Issue Summary shows a remaining task that is not done. If it has been done, it needs to be indicated in the issue summary as well.
The last patch here is from 12 months ago and I see no code review of that patch since then. Setting to NW for a code review. There is a test in the patch, so removing tag.
I notice there is a change for the seven them. Does this need to be applied to other themes as well?
@Devashish Jangid, There are several steps, or core gate that an issue must pass first before it can be RTBC. Some of that is in my comments above. Also, screenshots for the patch were added in #234 and the patch has not been changed. Adding unnecessary screenshots does not help move an issue forward. Therefor, credit has been removed per How is credit granted for Drupal core issues.
Comment #239
rakhi soni commentedI have created a patch to fix the issue of "Allow longer usernames displayed as links" for version 9.5x ,, kindly review patch.
Comment #240
asha nair commentedApplied #239 patch in 9.5.x-dev. Works fine for below 31 characters. Username is shown as some symbol when has more than 31 characters
Comment #241
asha nair commentedComment #242
bohus ulrychHi all, this very simple patch #239 doesn't make sense to me.
It only increases limit for truncating from 20 to 30 characters.
If there are more than 30, then strange logic is applied:
$name = Unicode::truncate($name, 0, 27) . '…';It seems like some garbage there.
And truncate function expects different arguments
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...
Patch #216 seems to be better option. Still works - tested with 9.4.7
Comment #244
smustgrave commented@Rakhi Soni thank you for the patch for #239 but appears to be missing bulk of the changes from the patch before. Is there a reason to move all those changes and tests?
#216 does appear to be the more complete solution. Which will need to be rerolled for 10.1.
Also may have to be updated for the other themes as mentioned in #238 by @quietone as seven is removed in core.
Also still needs issue summary udpate.
Please try to address the issues before rerolling.
Comment #245
quietone commentedYes, look at the tags and see what need to be done. Often, updating the patch is not what is needed to get an issue reviewed. In this case, an up to date issue summary is needed. A review needs to see accurate information in the Issue Summary before they look at the code. See Write an issue summary for an existing issue for guidance.
Comment #246
manojkumar_97 commentedI have created a patch on Drupal 10.1.x agains #216. pls verify ...
Comment #247
gaurav-mathur commentedhi, i'll review it :)
Comment #249
gaurav-mathur commentedVerified and tested patch#246 on Drupal 10.1.x Patch applied successfully.
Php Version:- 8.2
MySQL Version:- 8
Adding screenshot for the reference.
Thank You
Comment #250
gaurav-mathur commentedComment #251
smustgrave commentedThank you for the interest and the testing but please read the tags and comments also. This was tagged for issue summary update in #238
That’s what will be needed to move this ticket forward.