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).
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 3075860-20.patch | 9.73 KB | phenaproxima |
| #18 | 3075860-18.patch | 9.13 KB | phenaproxima |
| #16 | 3075860-16-FAIL.patch | 2.38 KB | phenaproxima |
| #14 | 3075860-14.patch | 4.58 KB | phenaproxima |
| #12 | 3075860-12.patch | 1.11 KB | phenaproxima |
Comments
Comment #2
phenaproximaThis 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.
Comment #3
phenaproximaLooking 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.
Comment #4
phenaproxima@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.
Comment #5
phenaproximaHere's a fail patch to prove the problem, and a green patch which fixes it.
Comment #6
phenaproximaCrediting @mishac for their help in diagnosing/fixing this issue.
Comment #9
mishac commentedSadly 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).Comment #10
phenaproximaAh, I see where I went wrong. How about this? (Doesn't have the tests, but this should still not fail abjectly.)
Comment #12
phenaproximaWhoops...forgot something important!
Comment #14
phenaproximaAnother try...this changes the approach so that, in theory, it shouldn't be possible to cause these errors at all.
Comment #16
phenaproximaHere's a proper fail patch that actually tests the problem.
Comment #18
phenaproximaAnd here it is with passing tests. (Or at least, they should be passing.)
Comment #20
phenaproximaOK, this should pass.
Comment #21
mishac commentedComment #22
mishac commentedPatch in #20 worked for me!
Comment #24
phenaproximaCommitted! Thanks :)