- Merge request !352Issue #3183509: Use the user display name instead of the username on the user authoring information in the node edit form โ (Open) created by Kristen Pol
- ๐บ๐ธUnited States smustgrave
At this time we will need a D10 MR of the issue. Since the work has been in MRs lets try and keep them there. But from the changes I saw they look good. Still need to do a full test and code review.
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
Liam Morland โ made their first commit to this issueโs fork.
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
I have rebased the branch so that the existing commits are on top of 11.x. I think @Kristen Pol will need to edit the merge request so that it targets 11.x instead of 9.2.x.
- ๐บ๐ธUnited States Kristen Pol Santa Cruz, CA, USA
Sorry for the delay... version changed.
- ๐ฆ๐บAustralia acbramley
acbramley โ changed the visibility of the branch 9.2.x to hidden.
- ๐ฆ๐บAustralia acbramley
acbramley โ changed the visibility of the branch 11.x to hidden.
- ๐บ๐ธUnited States smustgrave
Seems like a simple change, IS is clear
1) Drupal\Tests\node\Functional\NodeEditFormTest::testNodeAuthorDisplayName Behat\Mink\Exception\ExpectationException: The string "<em>3</em>" was not found anywhere in the HTML response of the current page. /builds/issue/drupal-3183509/vendor/behat/mink/src/WebAssert.php:888 /builds/issue/drupal-3183509/vendor/behat/mink/src/WebAssert.php:363 /builds/issue/drupal-3183509/core/tests/Drupal/Tests/WebAssert.php:559 /builds/issue/drupal-3183509/core/modules/node/tests/src/Functional/NodeEditFormTest.php:320 FAILURES! Tests: 4, Assertions: 105, Failures: 1.
Shows the test coverage
See no issue.
- ๐ณ๐ฟNew Zealand quietone
Instead of creating a new functional test for this one assertion, can the test be moved into the existing \Drupal\Tests\node\Functional\NodeEditFormTest::testNodeEdit method? I see @larowlan suggested reusing NodeEditFormTest which I think means a new method but testNodeEdit is for testing the functionality of that form. Leaving at RTBC.
- ๐ฌ๐งUnited Kingdom catch
Agreed with #34, saves a full Drupal install, moving to needs work for that.
- ๐ฆ๐บAustralia acbramley
I'm not a fan of dumping a huge number of assertions into such a generic test case where it's not really clear what the intention of the test is.
However, there is
testNodeMetaInformation
which seems fitting for this so I've moved it there. The Needs Review Queue Bot โ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- ๐ฎ๐ณIndia snehal-chibde
I have tested the changes on Drupal 11.0.x.
Following are the steps I have performed to test the same.-
- Installed the Real name module .
- Added a field 'First name'
- Under Real name tab, added [user:field_first_name]
I applied the latest MR and the value set for the field name added via Real name module is visible under the authoring information section on node edit page.
Added screenshots for reference. -
- ๐ฆ๐บAustralia acbramley
Going to self RTBC this since it was only set back for merging the test changes which were fixed with https://git.drupalcode.org/project/drupal/-/merge_requests/352/diffs?com...
- Issue was unassigned.
- Status changed to RTBC
about 1 month ago 1:25pm 28 June 2025 - ๐บ๐ธUnited States xjm
Great manual testing @Kristen Pol! And thanks @snehal-chibde for verifying it still works on Drupal 11.
Crediting @smustgrave for issue management and verifying the test-only patch fails as expected.
Saving credits.
- ๐บ๐ธUnited States xjm
I do have an additional question. Does this change core's behavior, without any contrib module? Can someone do before-and-after screenshots of core alone? If so, it's actually kind of a non-trivial change. I might ask the usability team or the UX managers for their +1 on the change to core if so. (I might be over-sensitive to this since I hate when things try to force me to display my "real name" instead of my username!) ๐
- ๐ฆ๐บAustralia acbramley
Does this change core's behavior, without any contrib module?
Not at all, this is the code of
getDisplayName
$name = $this->getAccountName() ?: \Drupal::config('user.settings')->get('anonymous'); \Drupal::moduleHandler()->alter('user_format_name', $name, $this); return $name;
There is no implementation of hook_user_format_name_alter in core, therefore it would be equivalent to
getAccountName
(what we're changing from). Unless we really care that the Anonymous user name is changing in this specific context.Reminder that this is just changing the Authoring Information part of the node edit form.
- ๐บ๐ธUnited States xjm
I don't totally agree that this is a bug, BTW, and would almost call it a feature request, but let's split the difference at "task". Either way, it doesn't matter, because it's in! Committed to 11.x only as a user interface change. Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.