Problem/Motivation

When having installed GDPR module and added all settings and all is fine, it turns out that when working with other content types, if trying to add field in the GUI, it crashes due to GDPR module is not sending correct info to

core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php doGetDefinition

which then crash and in that situation makes the site unusable for further use.

The module is not possible to uninstall, except deleting the folder for the module.

After doing that, adding fields works again.

CommentFileSizeAuthor
#4 3522586-Adding-field-bug-1.patch2.11 KBhenk

Issue fork gdpr-3522586

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

arne_hortell created an issue. See original summary.

arne_hortell’s picture

Reason for problem is field_type: gdpr_task_item

The field removal_log in module gdpr_tasks uses a fieldtype with ID gdpr_task_item which is not in the code at all.
That is the reason for "The plugin (GDPR) did not specify an instance class." in the above mentioned doGetDefinition.
I.e the use of gdpr_task_item exists but nothing is defining it like
(@FieldType(id = "gdpr_task_item"))

henk’s picture

Reason is that in Drupal 11.x using a translatable string as a category for field type is deprecated, also field_category.yml is needed. I have same problem and preparing patch for it.

henk’s picture

StatusFileSize
new2.11 KB

Here is a patch

henk’s picture

Error code:

AssertionError: "GDPR" must be defined in MODULE_NAME.field_type_categories.yml in assert() (line 183 of core/lib/Drupal/Core/Field/FieldTypePluginManager.php).
Drupal\Core\Field\FieldTypePluginManager->getGroupedDefinitions(Array, 'label', 'id') (Line: 131)
Drupal\field_ui\Form\FieldStorageAddForm->processFieldDefinitions(Object) (Line: 80)
Drupal\field_ui\Form\FieldStorageAddForm->buildForm(Array, Object, 'node', 'test')
...
henk’s picture

Status: Active » Needs review
henk’s picture

Title: add-field crashes » add field form crashes, "GDPR" must be defined in MODULE_NAME.field_type_categories.yml
henk’s picture

Version: 3.x-dev » 3.1.2
arne_hortell’s picture

Thanks!

  • henk committed db366f7e on 3.0.x
    #3522586: compability with Drupal 11

rajeshreeputra’s picture

Version: 3.1.2 » 3.x-dev
Status: Needs review » Fixed

Merged!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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

prashant.c’s picture

Seems like the fix is not present in the latest release, we are still getting the same error on Drupal 11.2 , had to apply the patch provided in this.

Thankyou

rajeshreeputra’s picture

Released 3.1.3 version, thanks!