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

Add default value for description field value #173

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Conversation

hyrsky
Copy link
Contributor

@hyrsky hyrsky commented Nov 6, 2024

Some TPR units do not have description, for example IDs 6667, 6913. For these units, the description value will be NULL. When the NULL value is rendered using readonly_field_widget, like here:

https://github.com/City-of-Helsinki/drupal-helfi-platform-config/blob/main/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml#L98-L107,

an error is logged from twig. The error message contains the whole render array, which can cause out of memory errors.

This PR adds default empty string to description value.

How to test

composer require drupal/helfi_tpr:dev-UHF-X-description-value
drush migrate:import tpr_unit --reset-threshold 1 --update

Some TPR units do not have description, for example IDs 6667, 6913.
For these units, the description value will be NULL. When the NULL
value is rendered using `readonly_field_widget`, like here:

https://github.com/City-of-Helsinki/drupal-helfi-platform-config/blob/main/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml#L98-L107

an error is logged from twig. The error message contains the whole
render array, which can cause out of memory errors.

This PR adds default empty string to description value.
Copy link

sonarqubecloud bot commented Nov 6, 2024

@hyrsky hyrsky marked this pull request as ready for review November 7, 2024 12:07
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