- heddn Nicaragua
That sub module and logic was only ever released in a dev branch. We have since removed that sub module.
- Status changed to Closed: won't fix
almost 2 years ago 5:07pm 20 February 2023 - heddn Nicaragua
I _think_ this can be cosed/wont-fix. But if someone disagrees, feel free to re-open.
- 🇫🇮Finland thatguy
I have an issue with the submodule menu_link_reference being removed in the 3.0.x branch. I understand that the dev-versions can have this kind of things happening and we shouldn't use them but at the moment there isn't other way to do it with Group v3.
So I tried to update to the latest dev-commit but I received error for the missing menu_link_reference module. I manually removed the dependency to the menu_link_reference submodule, then uninstalled it and updated group_content_menu to the latest dev-commit. Now I receive error "Drupal\Core\Entity\EntityStorageException: The "field_item:menu_link_reference" plugin does not exist.".
Any ideas what I could do without breaking the existing group content menus?
- Status changed to Active
almost 2 years ago 2:39pm 27 February 2023 - heddn Nicaragua
Let's add a post update that removes the field:
$entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); if ($entity_definition_update_manager->getEntityType('group_content_menu') !== NULL) { $storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('parent', 'group_content_menu'); if ($storage_definition !== NULL) { $entity_definition_update_manager->uninstallFieldStorageDefinition($storage_definition); } }
- Status changed to Closed: won't fix
almost 2 years ago 2:12pm 28 February 2023 - 🇫🇮Finland thatguy
Thanks @heddn that seems to fix the issue, although the problem is that I have to run it before updating to the latest dev-commit :D If there is other way to solve that would be nice but I can work with this I think.
Here are my steps that I needed to do, they are more complicated since these had to be done through deployments to couple of environments:
1. Create a patch with the post update hook posted by heddn at #5 and also include removal of dependency to menu_link_reference in group_content_menu.info.yml
2. Run patches but avoid updating module. Run update hook, uninstall menu_link_reference
3. Remove unneeded patches, update module
- Status changed to Active
almost 2 years ago 2:12pm 28 February 2023 - heddn Nicaragua
Oops, I also had to re-add a dummy plugin too.
/** * Defines the 'menu_link_reference' field type. * * @FieldType( * id = "menu_link_reference", * label = @Translation("Menu link reference"), * category = @Translation("General"), * default_widget = "menu_link_reference", * default_formatter = "string", * no_ui = TRUE, * ) */ final class MenuLinkReferenceItem extends FieldItemBase {}
- 🇨🇭Switzerland phma Basel, CH
It seems to get worse if you have data in the field. I'm not sure where the constraint comes from, because either of these can be NULL.
[error] SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'parent_id' cannot be null: INSERT INTO "field_deleted_data_d0a1ee0c5e" ("bund le", "entity_id", "revision_id", "langcode", "parent_menu_name", "parent_id", "deleted", "delta") SELECT "entity_table"."bundle" AS "bundle", "entity_t able"."id" AS "entity_id", "entity_table"."id" AS "revision_id", "entity_table"."langcode" AS "langcode", "entity_table"."parent__menu_name" AS "parent _menu_name", "entity_table"."parent__id" AS "parent_id", :deleted AS "deleted", :delta AS "delta" > FROM > "group_content_menu_field_data" "entity_table" > WHERE ("entity_table"."parent__menu_name" IS NOT NULL) OR ("entity_table"."parent__id" IS NOT NULL) FOR UPDATE; Array > ( > [:deleted] => 1 > [:delta] => 0 > )
- 🇺🇸United States jnicola
Okay, I believe this patch does the trick. It combines the post_update hook and the fake plugins.
What it does not do, and I have not tested yet, is the bit phma mentions when there is content in the field already. I'll write another patch for that if necessary.