Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config schema issues #46

Open
wants to merge 1 commit into
base: 8.x-1.x
Choose a base branch
from

Conversation

claudiu-cristea
Copy link

Split from #45

I split this part from #45 as it has a higher urgency and affects other modules (message_private) tests that are using message_ui.

There are bugs related to config schemas that were fixed. Related, is the function that has added new widgets to the default form but the widgets had erroneous settings. We should not make any assumption on new added fields, the site builder should explicitly add them to the entity form display.

@NewZeal
Copy link
Contributor

NewZeal commented Oct 13, 2018

What does this change actually do?

@claudiu-cristea
Copy link
Author

What does this change actually do?

@NewZeal, is fixing the configuration schema. See https://www.drupal.org/docs/8/api/configuration-api/configuration-schemametadata for a background on configuration schema. In this particular case there is a configuration option core.entity_form_display.message.private_mesage.default:uid.#group, added in message_ui_entity_base_field_info_alter(), that doesn't exist in schema. The schema of this widget is defined under core.entity_form_display.*.*.*: in web/core/config/schema/core.entity.schema.yml file.

Also the schema of field.widget.settings.entity_reference_autocomplete.settings.size enforces the type of this settings to integer but a string is passed in message_ui_entity_base_field_info_alter().

A 3rd aspect is that, in MessageUIFieldDisplayManagerService::setFieldsDisplay() the display hidden fields are enabled but wrongly, by adding a field_name option under the entity display component options, but there's no such option in the schema of the entity form display component. See the same core.entity_form_display.*.*.*:content.*. Also, when creating default entity displays for message templates that are missing such displays, we should not make any assumption on new added fields, the site builder should explicitly add them to the entity form display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants