- heddn Nicaragua
+++ b/realname.module @@ -288,6 +290,20 @@ function realname_delete_all() { + $fields['realname_field'] = BaseFieldDefinition::create('string')
I think I like the name
realname
only a bit better. It will match the full name of this module.Also, would it make sense to add a test or 2 to make sure this doesn't have regressions?
- Status changed to Needs work
almost 2 years ago 4:44pm 2 March 2023 - 🇭🇺Hungary nevergone Nyíregyháza, Hungary, Europe
#3259991-6: Create computed field → patch rerolled, the existing test are green.
- 🇭🇺Hungary nevergone Nyíregyháza, Hungary, Europe
#3259991-10: Create computed field → is fixed.
- 🇮🇳India sumit-k
Hi, I have prepared a patch that includes fixes for the issues mentioned, along with the corresponding tests. Please review.
- last update
over 1 year ago 5 pass - Status changed to Needs review
over 1 year ago 4:30am 30 June 2023 - last update
over 1 year ago 4 pass - last update
over 1 year ago 5 pass - 🇭🇺Hungary nevergone Nyíregyháza, Hungary, Europe
@sumit-k: Thanks the test.
Please test the following patch.
This is remove duplicated real name fields with Layout builder:
Next step:
Create configuration update path from the old psuedo field to new computed field. - Status changed to Needs work
over 1 year ago 8:52pm 4 July 2023 - heddn Nicaragua
+++ b/realname.module @@ -36,20 +38,6 @@ function realname_help($route_name, RouteMatchInterface $route_match) { -function realname_entity_extra_field_info() {
Instead of removing this, can we mark it deprecated in the name or something? It would be great to have both there in the code base while we stabilize the conversion to a computed field.
-
+++ b/realname.module @@ -64,7 +52,7 @@ function realname_user_format_name_alter(&$name, AccountInterface $account) { + if (is_string($account->realname) && mb_strlen($account->realname)) { @@ -119,10 +107,14 @@ function realname_user_view(array &$build, EntityInterface $account, EntityViewD + if (is_string($account->realname)) { ... + if (is_string($account->realname)) {
why these changes?
-
+++ b/tests/src/Functional/RealnameBasicTest.php @@ -149,7 +149,7 @@ class RealnameBasicTest extends BrowserTestBase { + $edit = ['fields[realname_field][region]' => 'content'];
I thought the field was renamed, why is this still with a
_field
suffix added? And if it was working either way, what is this actually testing?
-
- 🇭🇺Hungary nevergone Nyíregyháza, Hungary, Europe
Instead of removing this, can we mark it deprecated in the name or something? It would be great to have both there in the code base while we stabilize the conversion to a computed field.
The problem is that if we don't remove it, we can't avoid the annoying repetition shown in the image above.
I thought the field was renamed, why is this still with a _field suffix added? And if it was working either way, what is this actually testing?
The _field suffix is added because the field was not actually deleted, only displayed (extra field).
The test does the same thing as before.Consideration should be given to moving this task to version 3.x, along with a thorough refactoring.