Skip to content

Commit

Permalink
Merge pull request #205 from openeuropa/ISSUE-204
Browse files Browse the repository at this point in the history
ISSUE-204: Make sure the field exists before updating its description.
  • Loading branch information
brummbar authored Mar 3, 2023
2 parents d4adf89 + 4e98366 commit 0ca2fad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/oe_media_webtools/oe_media_webtools.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ function oe_media_webtools_post_update_00005() {

foreach ($fields as $field) {
$field_config = FieldConfig::load($field);
// If the field doesn't exist anymore, skip it.
if (!$field_config) {
continue;
}
// If the description has been customised by users, we don’t change it.
if ($original_description !== $field_config->get('description')) {
$modified[] = $field;
Expand Down

0 comments on commit 0ca2fad

Please sign in to comment.