- πΊπΈUnited States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β as a guide.
Ran the test locally to make sure it failed and did get
Drupal\Component\Plugin\Exception\PluginNotFoundException : The "block_content" entity type does not exist.
Not entirely sure about adding a new file but could be wrong
Lets see what the committers say.
- Status changed to Needs work
almost 2 years ago 2:40am 7 February 2023 - π³πΏNew Zealand quietone
Looking at the process plugin, it does have a dependency on d7_custom_block. Therefore, all that needs to be done here is add that as a required dependency on d7_block. Refer to d6_block.yml for an example.
- Status changed to Needs review
almost 2 years ago 8:08am 7 February 2023 - π¬π§United Kingdom Wongjn
Shouldn't it be possible to run d7_block without d7_custom_block (and thus implicitly, without the Block Content module)? The constructor for the
BlockPluginId
tries to consider this fact, but I believe it was a simple programming error that needed to passFALSE
as a second argument for the ternary, otherwise this ternary would serve no purpose. - Status changed to Needs work
almost 2 years ago 6:39pm 16 February 2023 - πΊπΈUnited States smustgrave
Could you provide a quick test that shows that?
- Status changed to Needs review
almost 2 years ago 7:32am 18 February 2023 - πΊπΈUnited States smustgrave
On D10 uninstalled block_content
Ran ddev drush mim --tag "Drupal 7" d7_block
got the error in the IS
Applied the patch
And am able to run successfully.Also curious of the block_content module is needed as these blocks coming over after custom right?
Will mark it if no one has any objection
- Status changed to RTBC
almost 2 years ago 6:12pm 3 March 2023 - Status changed to Needs work
almost 2 years ago 8:26am 31 March 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I'm not sure this is the right fix
If you look at Drupal 7's codebase, the block_custom entries were in a database table defined by the block module - https://git.drupalcode.org/project/drupal/-/blob/7.x/modules/block/block...
In Drupal 8+ we split it into two modules (I worked on the patch π)
I think this implies that if you had the block module in D7, you need both the block and block_content modules in D9.
Is there a way we can install the module if its not enabled? That feels to me like the right approach.
This is what @quietone one said in #7 too
- Status changed to Needs review
over 1 year ago 4:29am 30 June 2023 - last update
over 1 year ago 29,567 pass, 2 fail - last update
over 1 year ago 29,568 pass - π³πΏNew Zealand quietone
I looked into this today.
I do not know what the intention was in the ternary in BlockPluginID. In this issue that committed that process plugin, the d6_block migration was also added and that did not have a dependency on d6_custom_block. A required dependency on d6_custom_block was added later #2250429: d6_block migration not migrating all blocks β . The Drupal 7 block migration has an optional dependency on d7_custom_block. Since it is optional (and yes I tested) then d7_block should run without block_content.
That means that the change here is the right thing to do. It allows d7_block to run when block_content is not installed.
#13. I don't recall a case where we install a module to run a migration.
I've made a patch and fail path.
The last submitted patch, 15: 3331059-15-fail.patch, failed testing. View results β
- Status changed to RTBC
over 1 year ago 9:34pm 2 July 2023 - πΊπΈUnited States smustgrave
Retested this.
On my Drupal10.1 site I uninstalled block_content
Connecting to my Drupal7 site and running the migrate:import for d7_block I do get the error reported
Applying patch #15 resolved the issue. - last update
over 1 year ago 29,572 pass - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,803 pass - last update
over 1 year ago 29,803 pass - last update
over 1 year ago 29,807 pass - last update
over 1 year ago 29,812 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,823 pass - last update
over 1 year ago 29,828 pass - last update
over 1 year ago 29,879 pass - last update
over 1 year ago 29,880 pass - last update
over 1 year ago 29,885 pass - last update
over 1 year ago 29,888 pass - last update
over 1 year ago 29,912 pass - last update
over 1 year ago 29,947 pass - last update
over 1 year ago 29,953 pass - last update
over 1 year ago 29,954 pass - last update
over 1 year ago 29,954 pass - π³πΏNew Zealand quietone
All questions have been answered. I have updated the title and added details to the issue summary.
- last update
over 1 year ago 29,959 pass - last update
over 1 year ago 29,959 pass - last update
over 1 year ago 29,936 pass, 1 fail The last submitted patch, 15: 3331059-15.patch, failed testing. View results β
- last update
over 1 year ago 29,962 pass - last update
over 1 year ago 30,048 pass - last update
over 1 year ago 30,053 pass - last update
over 1 year ago 30,057 pass - last update
over 1 year ago 30,059 pass - last update
over 1 year ago 30,061 pass - last update
over 1 year ago 30,061 pass - π³πΏNew Zealand quietone
I'm triaging RTBC issues β . I re-read the IS and the comments. I didn't find any unanswered questions or other work to do.
Leaving at RTBC.
- last update
over 1 year ago 30,101 pass - last update
over 1 year ago 30,136 pass - last update
over 1 year ago 30,136 pass - last update
over 1 year ago 30,137 pass - last update
over 1 year ago 30,147 pass - last update
over 1 year ago 30,147 pass - last update
over 1 year ago 30,149 pass - last update
over 1 year ago 30,158 pass - last update
over 1 year ago 30,162 pass - last update
over 1 year ago 30,165 pass - last update
over 1 year ago 30,165 pass, 2 fail The last submitted patch, 15: 3331059-15.patch, failed testing. View results β
- last update
over 1 year ago 30,169 pass - last update
over 1 year ago 30,169 pass - last update
over 1 year ago 30,206 pass - last update
over 1 year ago 30,364 pass - last update
over 1 year ago 30,362 pass - last update
over 1 year ago 30,361 pass - Status changed to Needs work
over 1 year ago 8:15pm 30 September 2023 - πΊπΈUnited States xjm
Mostly nitpicks, but also a request for a followup issue.
-
+++ b/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php @@ -41,12 +41,12 @@ class BlockPluginId extends ProcessPluginBase implements ContainerFactoryPluginI - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage, MigrateLookupInterface $migrate_lookup) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage = NULL, MigrateLookupInterface $migrate_lookup) {
Technically, the
@storage
typehint is now incorrect. It should be?EntityStorageInterface
.However, that causes a PHP deprecation I wasn't aware of:
https://3v4l.org/XAAhcIf we keep the incorrect typehint, there's no error:
https://3v4l.org/ANminHowever, I think we at least need a followup issue to reorder the parameters so that we can eventually both have correct typehinting and order the arguments as PHP now wants us to.
-
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockNoBlockContentTest.php @@ -0,0 +1,161 @@ + * Tests migration of blocks without block content installed.
This is missing the word "the". Also, Block Content should be title-cased.
-
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockNoBlockContentTest.php @@ -0,0 +1,161 @@ + public function testBlockMigration() {
Missing return typehint.
-
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockNoBlockContentTest.php @@ -0,0 +1,161 @@ + $this->assertEntity('bartik_system_main', 'system_main_block', [], '', 'content', 'olivero', 0, '', '0'); + $this->assertEntity('bartik_search_form', 'search_form_block', [], '', 'content', 'olivero', -1, '', '0'); + $this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'content', 'olivero', 0, 'User login title', 'visible'); + $this->assertEntity('bartik_system_powered_by', 'system_powered_by_block', [], '', 'footer_bottom', 'olivero', 10, '', '0'); + $this->assertEntity('seven_system_main', 'system_main_block', [], '', 'content', 'claro', 0, '', '0'); + $this->assertEntity('seven_user_login', 'user_login_block', [], '', 'content', 'claro', 10, 'User login title', 'visible');
This kind of looks like it wants to be a data provide rarther than a helper assertion method. Or is it important that all these things are true in the same test setup?
-
- Status changed to Needs review
over 1 year ago 6:50am 1 October 2023 - last update
over 1 year ago 30,361 pass - π³πΏNew Zealand quietone
#24
1. working on it
2. Done
3. Done
4. This is not something for a dataprovider. Like most migration kernel tests it is testing 'something' or 'somethings' after the selected set of migrations run using the source test fixture. We definitely want to confirm that the 'set' of things we are migrating are done so correctly, no just an individual item. - π³πΏNew Zealand quietone
Follow up is π Correct type hint and order of parameters in BlockPluginId Active . Removing tag.
- Status changed to RTBC
over 1 year ago 5:34pm 1 October 2023 - πΊπΈUnited States smustgrave
Points have been addressed.
Actually didn't know we need :void for test methods but good to know going forward.
- πΊπΈUnited States xjm
Thanks @quietone! I agree with your explanation on point 4.
For point 1, when I was discussing the new PHP 8.1 deprecation related to it, @alexpott pointed out that we had past coding standards cleanups for this: #2901790: Fix 'PEAR.Functions.ValidDefaultValue' coding standard β
If that's so, and it looks like it was, how is this patch passing Custom Commands? Did the rule not get enabled?
If it's okay I'm going to tag this for FM review since it's sort of a code smell -- we cleaned all the examples of this sort of thing up for a reason. Plus alexpott is kind of the leading expert on the history of our coding standards cleanups (although I am sure @quietone or @smustgrave could also do the research to provide more info as well; go for it if so inclined).
Cheers,
Jess - π¬π§United Kingdom alexpott πͺπΊπ
xjm β credited alexpott β .
- πΊπΈUnited States xjm
Also, if patches are canonical on this issue, can we close the old MR?
Adding credit for @alexpott for background info in Slack.
- last update
about 1 year ago 30,372 pass - last update
about 1 year ago 30,380 pass - last update
about 1 year ago 30,378 pass - last update
about 1 year ago 30,383 pass - last update
about 1 year ago 30,393 pass - Status changed to Needs work
about 1 year ago 8:23am 12 October 2023 - π¬π§United Kingdom alexpott πͺπΊπ
+++ b/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php @@ -41,12 +41,12 @@ class BlockPluginId extends ProcessPluginBase implements ContainerFactoryPluginI - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage, MigrateLookupInterface $migrate_lookup) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage = NULL, MigrateLookupInterface $migrate_lookup) {
This should be
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ?EntityStorageInterface $storage, MigrateLookupInterface $migrate_lookup) {
You have to intentionally pass a NULL in and we should not be providing a default value because $migrate_lookup is not optional. - π¬π§United Kingdom alexpott πͺπΊπ
#31 will make π Correct type hint and order of parameters in BlockPluginId Active obsolete.
We should also improve the documentation for the param.. something like
* @param \Drupal\Core\Entity\EntityStorageInterface|null $storage * The block content storage object. NULL if the block_content module is not installed.
Also
+++ b/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php @@ -61,7 +61,7 @@ public static function create(ContainerInterface $container, array $configuratio - $entity_type_manager->getDefinition('block_content') ? $entity_type_manager->getStorage('block_content') : NULL, + $entity_type_manager->getDefinition('block_content', FALSE) ? $entity_type_manager->getStorage('block_content') : NULL,
Let's use useDefinition() here - it make more semantic sense. Ie:
$entity_type_manager->hasDefinition('block_content') ? $entity_type_manager->getStorage('block_content') : NULL,
- Status changed to Needs review
about 1 year ago 7:45am 23 October 2023 - last update
about 1 year ago 30,427 pass - Status changed to RTBC
about 1 year ago 2:34pm 23 October 2023 - πΊπΈUnited States smustgrave
Appears feedback for NULL has been addressed.
- π¬π§United Kingdom alexpott πͺπΊπ
Committed and pushed 49ecf1d7e85 to 11.x and d670582a0cd to 10.2.x and bfa78acfe04 to 10.1.x. Thanks!
-
alexpott β
committed 49ecf1d7 on 11.x
Issue #3331059 by quietone, Wongjn, ameymudras, smustgrave, xjm,...
-
alexpott β
committed 49ecf1d7 on 11.x
-
alexpott β
committed d670582a on 10.2.x
Issue #3331059 by quietone, Wongjn, ameymudras, smustgrave, xjm,...
-
alexpott β
committed d670582a on 10.2.x
- Status changed to Fixed
about 1 year ago 9:12pm 23 October 2023 -
alexpott β
committed bfa78acf on 10.1.x
Issue #3331059 by quietone, Wongjn, ameymudras, smustgrave, xjm,...
-
alexpott β
committed bfa78acf on 10.1.x
Automatically closed - issue fixed for 2 weeks with no activity.