Getting plugin errors for missing layouts when migrating:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "onecol" plugin does not exist. Valid plugin IDs for Drupal\Core\Layout\LayoutPluginManager are: ds_1col, ds_1col_wrapper, ds_2col, ds_2col_fluid, ds_2col_stacked, ds_2col_stacked_fluid, ds_3col, ds_3col_equal_width, ds_3col_stacked, ds_3col_stacked_fluid, ds_3col_stacked_equal_width, ds_4col, ds_reset, layout_twocol_section, layout_threecol_section, layout_fourcol_section, layout_onecol, layout_twocol, layout_twocol_bricks, layout_threecol_25_50_25, layout_threecol_33_34_33, 1col_stacked, layout_builder_blank in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /app/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Comments

mishac created an issue. See original summary.

phenaproxima’s picture

Issue tags: +Needs tests

This makes complete sense to me. LayoutBuilderMigration doesn't bother mapping the layout plugin IDs when migrating to Layout Builder, which I can see causing problems. This will need test coverage, but the fix should be straightforward after that.

phenaproxima’s picture

Looking at this again, here's the thing I don't understand -- I don't know how it is possible to arrive at this point. Ever since Layout Discovery landed in core (which was a while ago), Panelizer has included a migration path that changes all stored layout IDs to the correct ones. So how did this happen? A sanitized database dump would be helpful here, I think.

phenaproxima’s picture

@mishac very kindly sent me a database dump, and it was quick work to find the problem: the Panelizer 4.x update path which updates the layout IDs (see panelizer_post_update_rename_layout_machine_names()) doesn't handle revisions! So, the Layout Builder migration needs to deal with this.

phenaproxima’s picture

Status: Active » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.33 KB
new2.69 KB

Here's a fail patch to prove the problem, and a green patch which fixes it.

phenaproxima’s picture

Crediting @mishac for their help in diagnosing/fixing this issue.

The last submitted patch, 5: 3075860-5-FAIL.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 5: 3075860-5-PASS.patch, failed testing. View results

mishac’s picture

Sadly I'm still getting the same issue:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "onecol" plugin does not exist. Valid plugin IDs for Drupal\Core\Layout\LayoutPluginManager are: ds_1col, ds_1col_wrapper, ds_2col, ds_2col_fluid, ds_2col_stacked, ds_2col_stacked_fluid, ds_3col, ds_3col_equal_width, ds_3col_stacked, ds_3col_stacked_fluid, ds_3col_stacked_equal_width, ds_4col, ds_reset, layout_twocol_section, layout_threecol_section, layout_fourcol_section, layout_onecol, layout_twocol, layout_twocol_bricks, layout_threecol_25_50_25, layout_threecol_33_34_33, 1col_stacked, layout_builder_blank in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /app/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new785 bytes

Ah, I see where I went wrong. How about this? (Doesn't have the tests, but this should still not fail abjectly.)

Status: Needs review » Needs work

The last submitted patch, 10: 3075860-10.patch, failed testing. View results

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new1.11 KB

Whoops...forgot something important!

Status: Needs review » Needs work

The last submitted patch, 12: 3075860-12.patch, failed testing. View results

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new4.58 KB

Another try...this changes the approach so that, in theory, it shouldn't be possible to cause these errors at all.

Status: Needs review » Needs work

The last submitted patch, 14: 3075860-14.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new2.38 KB

Here's a proper fail patch that actually tests the problem.

Status: Needs review » Needs work

The last submitted patch, 16: 3075860-16-FAIL.patch, failed testing. View results

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new9.13 KB

And here it is with passing tests. (Or at least, they should be passing.)

Status: Needs review » Needs work

The last submitted patch, 18: 3075860-18.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new9.73 KB

OK, this should pass.

mishac’s picture

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

Patch in #20 worked for me!

  • phenaproxima committed 5e671cb on 8.x-5.x
    Issue #3075860 by phenaproxima, mishac: PluginNotFoundException when...
phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Thanks :)

Status: Fixed » Closed (fixed)

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