Problem/Motivation

[COMMIT_HASH]

f453c2d44af202300161b2d65753bbbfbff12212

[RESULTS_OUTPUT]

[OK] No errors

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Adrianm6254 created an issue. See original summary.

michaellander’s picture

Status: Active » Closed (works as designed)
primsi’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new3.48 KB

Reopening this, because it seems that there are a few issues that need addressing:

  31x: Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement ConfigurableInterface and/or DependentPluginInterface directly as needed. If you implement ConfigurableInterface you may choose to implement ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility, however this must be removed prior to Drupal 9. See https://www.drupal.org/node/2946161

  4x: Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.

  4x: Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting. The uid field on the node.block_field_test.default form display is missing it. This BC layer will be removed before 9.0.0. See https://www.drupal.org/node/2863188

  3x: Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting. The uid field on the node.block_node.default form display is missing it. This BC layer will be removed before 9.0.0. See https://www.drupal.org/node/2863188

Seems like the functional tests rely on some classes that are not available in stark theme, so going with classy.

Regarding the ConfigurablePluginInterface change, as far as I can see we don't need DependentPluginInterface, because calculateDependencies was empty, so I removed it.

Also added the changes for info files, as per https://www.drupal.org/node/3070687

Didn't address the match_limit issues as per @Berdir's comment here: https://www.drupal.org/project/geolocation/issues/3107798#comment-13443022

berdir’s picture

Status: Needs review » Reviewed & tested by the community

looks good.

lisa.rae’s picture

Status: Reviewed & tested by the community » Needs work

One minor issue, after applying the patch and rescanning:

21/21 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -------------------------------------------------------------
Line tests/src/Functional/BlockFieldTest.php
------ -------------------------------------------------------------
165 Call to deprecated function entity_get_display():
in drupal:8.8.0 and is removed from drupal:9.0.0. Use
EntityDisplayRepositoryInterface::getViewDisplay() instead.
------ -------------------------------------------------------------

[ERROR] Found 1 error

swatichouhan012’s picture

Status: Needs work » Needs review
StatusFileSize
new3.48 KB

Hii, after applying patch i found no deprecation is remaining in the module. re uploading patch because of composer failure.

berdir’s picture

Status: Needs review » Needs work
+++ b/tests/modules/block_field_test/block_field_test.info.yml
@@ -2,7 +2,6 @@ name: 'Block field module tests'
 package: Testing
-core: 8.x
 dependencies:
   - block_field

it doesn't make sense to require only 8.7 and remove this from test modules, which is something that's only possible since 8.8.2 or so. Test modules should have the same core_version_requirement key

swatichouhan012’s picture

Status: Needs work » Needs review
StatusFileSize
new3.79 KB
new1.29 KB

added same core_version_requirement and core version in test module and also fixed dependency name prefixed wit project name.

berdir’s picture

Status: Needs review » Needs work
+++ b/block_field.info.yml
@@ -5 +5,2 @@
-core_version_requirement: ^8.7.7 || ^9
+core: 8.x
+core_version_requirement: ^8 || ^9

This change isn't correct, the module requires 8.7.7 which also means you need to remove the core key, same in the test modules. So before it was correct in the block_field.info.yml and the test modules should have the same.

swatichouhan012’s picture

Status: Needs work » Needs review
StatusFileSize
new3.89 KB
new1.33 KB

@Berdir thanks for review patch, i have updated version in new patch.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good now I think.

lisa.rae’s picture

StatusFileSize
new16.92 KB

Rerolls patch to address test using deprecated method entity_get_display().

lisa.rae’s picture

Status: Reviewed & tested by the community » Needs review
berdir’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/Field/FieldFormatter/BlockFieldFormatter.php
    @@ -62,6 +151,13 @@ class BlockFieldFormatter extends FormatterBase {
             ->applyTo($elements[$delta]);
    +
    +      // If an alter hook wants to modify the block contents, it can append
    +      // another #pre_render hook.
    +      $this->moduleHandler->alter(['block_view', "block_view_{$base_id}"], $elements[$delta], $block_instance);
    +      ¶
    +      // Allow altering of cacheability metadata or setting #create_placeholder.
    +      $this->moduleHandler->alter(['block_build', "block_build_{$base_id}"], $elements[$delta], $block_instance);
    

    this seems to include quite a few unrelated changes, the alter hooks, category negate?

  2. +++ b/tests/src/Functional/BlockFieldTest.php
    @@ -156,6 +161,19 @@ class BlockFieldTest extends BrowserTestBase {
    +    // Use the Block Field Label formatter for the field_block_field_test display.
    +    \Drupal::service('entity_display.repository')
    +      ->getViewDisplay('node', 'block', 'default')
    +      ->setComponent('field_block_field_test', [
    +        'type' => 'block_field_label',
    +      ])
    +      ->save();
    +
    +  // Assert only the label is shown.
    +    $this->drupalGet($block_node->toUrl());
    +    $assert->responseNotMatches('/\d\d:\d\d:\d\d \(\d+\)/');
    +    $assert->elementContains('css', $selector, 'Time');
    +
    

    This means we need to require 8.8 if this really needs to be in this patch? looks like extra, new test coverage?

    Also missing spaces on the comment.

berdir’s picture

Yeah, this went from 4kb to 16kb, that's a lot of extra stuff.

lisa.rae’s picture

Disregard patch #12 above, not sure where my head was at. It is not needed, patch #10 addresses issues on this project.

berdir’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC then. You likely tested a combined patch, that's always tricky with this D9 issues. it does mean that the issue that adds that test coverage and uses entity_get_display() for that will need to be rerolled and require 8.8 then once this is in.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone, committed #10.

  • Berdir committed 5150c86 on 8.x-1.x
    Issue #3042702 by swatichouhan012, lhridley, Primsi, Berdir: Drupal 9...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hugovk’s picture

Thanks all for this! Good to see this is ready for D9!

I see https://www.drupal.org/project/block_field/issues/3043558 is for tracking the beta release, please may I ask for a new alpha release?

It would be great to see block_field show as green in the Upgrade Status list :)
https://www.drupal.org/project/upgrade_status

Also, please could you add a "Drupal 9" section to this project's "Project information"?

For example, compare with: https://www.drupal.org/project/upgrade_status

hugovk’s picture

Also, please could you add a "Drupal 9" section to this project's "Project information"?

And here's official guidance for this: https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for...