- Issue created by @mglaman
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Looking great already! Did a pre-emptive review 🤓
- 🇺🇸United States mglaman WI, USA
This has uncovered 🐛 Cannot delete a field which uses JSON type Active
- 🇭🇺Hungary attilatilman
Pipeline failure is not because of the MR changes, it is a different issue. MR LGTM!
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I'm concerned about applying 🐛 Cannot delete a field which uses JSON type Active — that's the first time XB is literally relying on a core patch. We've managed to avoid that so far.
The XB field type itself also uses JSON storage. See
\Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem::schema()
.AHHHHHH — that is literally the code that revealed that core bug! 🤯😱
But I made this use exactly the same pattern that Metatag uses, hence this bit:
* @see https://git.drupalcode.org/project/metatag/-/blob/2.0.x/src/Plugin/Field/FieldType/MetatagFieldItem.php
in
\Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem
.So why is the Metatag module not running into the same problem? 🤔
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Transplanted the relevant bits from #13 to the core bug report: #3487533-8: Cannot delete a field which uses JSON type → .
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
This is looking great! 👏
Concerns:
- developing XB now requires a changed setup: a core patch now is required 😬 — also not clear why the Metatag module doesn't have the same problem?! See #14.
- the
::setProvider()
magic trick that @larowlan approved needs some docs, because it is not at all obvious nor common (but neat!) - Default config for Metatag: how do we avoid the need for the XB module to need to provide an update path now?
- 🇺🇸United States mglaman WI, USA
The MR has been updated to use the approach found in the
json_field
module, where SQLite uses the "text" type, avoiding the core patch. - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Now only needs final sign-off from @tedbow WRT for this change:
- 'sqlite_type' => 'json', + // @todo Change back to 'json' once https://www.drupal.org/i/3487533 is resolved. + 'sqlite_type' => 'text',
(Due to @tedbow's work on 📌 Prevent modules from being uninstalled if they provide field types used in an Experience Builder field Fixed .)
- First commit to issue fork.
Automatically closed - issue fixed for 2 weeks with no activity.