From d7cdb3a16443c92e09111cb50108107ab7acd039 Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Tue, 21 Nov 2023 18:27:48 +0530 Subject: [PATCH 1/2] Fix field prefix issue --- src/FieldAttributeConverter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/FieldAttributeConverter.php b/src/FieldAttributeConverter.php index ff65cc05e..8d5c0c2a5 100644 --- a/src/FieldAttributeConverter.php +++ b/src/FieldAttributeConverter.php @@ -82,7 +82,11 @@ public function __construct(EntityFieldManagerInterface $entity_field_manager, F * Prefix of the field. */ protected function getFieldPrefix(): string { - return (string) $this->config->get('field_ui.settings')->get('field_prefix'); + // If the Field UI module is installed, and has a specific prefix + // configured, use that. Otherwise, just default to using 'field_' as + // a prefix, which is the default that Field UI ships with. + $prefix = $this->config->get('field_ui.settings')->get('field_prefix') !== NULL ? $this->config->get('field_ui.settings')->get('field_prefix') : 'field_'; + return (string) $prefix; } /** From 12836836252bb57ba355653bc4a6df95a09c6383 Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Fri, 1 Dec 2023 12:32:42 +0530 Subject: [PATCH 2/2] Added Field UI module dependency --- apigee_edge.info.yml | 1 + apigee_edge.install | 8 ++++++++ src/FieldAttributeConverter.php | 6 +----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apigee_edge.info.yml b/apigee_edge.info.yml index 08ef87702..279c0ae0a 100644 --- a/apigee_edge.info.yml +++ b/apigee_edge.info.yml @@ -7,6 +7,7 @@ core_version_requirement: ^10 dependencies: - drupal:file + - drupal:field_ui - drupal:user - entity:entity - drupal:filter diff --git a/apigee_edge.install b/apigee_edge.install index 941bb79c0..49e440f1f 100644 --- a/apigee_edge.install +++ b/apigee_edge.install @@ -389,3 +389,11 @@ function apigee_edge_update_9002() { $edge_settings['content']['callbackUrl'] = $new_edge_settings['content']['callbackUrl']; $config_storage->write('core.entity_view_display.developer_app.developer_app.default', $edge_settings); } + +/** + * Install Field UI module to maintain dependency. + */ +function apigee_edge_update_9003() { + // Installing the field UI module. + \Drupal::service('module_installer')->install(['field_ui']); +} diff --git a/src/FieldAttributeConverter.php b/src/FieldAttributeConverter.php index 8d5c0c2a5..ff65cc05e 100644 --- a/src/FieldAttributeConverter.php +++ b/src/FieldAttributeConverter.php @@ -82,11 +82,7 @@ public function __construct(EntityFieldManagerInterface $entity_field_manager, F * Prefix of the field. */ protected function getFieldPrefix(): string { - // If the Field UI module is installed, and has a specific prefix - // configured, use that. Otherwise, just default to using 'field_' as - // a prefix, which is the default that Field UI ships with. - $prefix = $this->config->get('field_ui.settings')->get('field_prefix') !== NULL ? $this->config->get('field_ui.settings')->get('field_prefix') : 'field_'; - return (string) $prefix; + return (string) $this->config->get('field_ui.settings')->get('field_prefix'); } /**