- π¨π΄Colombia jidrone
Git was recognizing one file as binary when it generates the patch, by I found a workaround.
- π¨π΄Colombia jidrone
Those dump files for update tests produce a lot of weird errors, hopefully I fixed all.
- π¨π΄Colombia jidrone
Maybe disabling the Spell check on some config imports.
Interdiff agains 83 because 84 didn't improve the issue.
- πΊπΈUnited States smustgrave
+1 for me but will let someone else see what they think.
- Status changed to Needs work
almost 2 years ago 7:23pm 10 February 2023 - πΊπΎUruguay rpayanm
I tested manually the patch from #85.
Test #1
1. I used an empty Drupal 10.1.x
2. Applied the patch
3. Installed Drupal
4. Followed the patch from the ISIt worked as expected.
Test #2:
1. I used an empty Drupal 10.1.x
2. Installed Drupal
3. Followed the steps from IS
4. Applied the patch from the IS
5. Ran "drush updb".It worked as expected, but I had to repeat the step 4: Check formatter option "Link to the Content", because it was unchecked after the update.
Let me know if I did something wrong.
- Status changed to Needs review
almost 2 years ago 8:13pm 10 February 2023 - π¨π΄Colombia jidrone
Hi rpayanm,
That's the expected behavior after running the update, because it sets the formatter to match the hardcoded values to avoid unintended results on existing sites using that formatter.
- Status changed to RTBC
almost 2 years ago 10:36pm 10 February 2023 - Status changed to Needs work
over 1 year ago 3:23pm 17 March 2023 - π¬π§United Kingdom catch
#2226493: Apply formatters and widgets to Node base fields β says it covered this, but looks like it didn't?
-
+++ b/core/modules/language/language.post_update.php @@ -13,3 +16,32 @@ function language_removed_post_updates() { + +/** + * Set language form display component as plain text and with label above. + */ +function language_post_update_language_component_plain_text(&$sandbox = []) { + $config_entity_updater = \Drupal::classResolver(ConfigEntityUpdater::class); + + $callback = function (EntityViewDisplayInterface $view_display) { + // Only update node view modes. + if ($view_display->getTargetEntityTypeId() !== 'node') { + return FALSE; + } + // Update language component if present. + if ($view_display->getComponent('langcode')) { + // Set label above as it was. + $langcode['label'] = 'above'; + // Set to show it as plain text. + $langcode['settings'] = [ + 'link_to_entity' => FALSE, + 'native_language' => FALSE, + ]; + $view_display->setComponent('langcode', $langcode); + return TRUE; + } + return FALSE; + }; + + $config_entity_updater->update($sandbox, 'entity_view_display', $callback);
The logic here also needs to run in config entity presave so that it's applied to configuration shipped with modules and install profiles. Quite a lot of examples of this in 9.5 and 10.1, especially but not exclusively in views.
-
+++ b/core/modules/node/src/NodeViewBuilder.php @@ -41,16 +41,6 @@ public function buildComponents(array &$build, array $entities, array $displays, - // Add Language field text element to node render array. - if ($display->getComponent('langcode')) { - $build[$id]['langcode'] = [ - '#type' => 'item', - '#title' => t('Language'), - '#markup' => $entity->language()->getName(), - '#prefix' => '<div id="field-language-display">', - '#suffix' => '</div>', - ]; - } }
Does the configured formatter end up in the same place in the render array?
-