Skip to content

Commit

Permalink
Fix for failed update when apiProduct field is disabled (#429)
Browse files Browse the repository at this point in the history
* Fix for failed update when apiProduct field is disabled
  • Loading branch information
divya-intelli authored May 9, 2023
1 parent 13bb643 commit 55855eb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apigee_m10n.install
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ function apigee_m10n_update_8203(&$sandbox) {
$display_repository = \Drupal::service('entity_display.repository');
// Get the default view display for xrateplan.
$view_display = $display_repository->getViewDisplay('xrate_plan', 'xrate_plan', 'default');
$component = $view_display->getComponent('apiProduct');
$settings = [
'link' => false,
];
$view_display->setComponent('apiProduct', ['settings' => $settings,] + $component)->save();
if ($component = $view_display->getComponent('apiProduct')) {
$settings = [
'link' => false,
];
$view_display->setComponent('apiProduct', ['settings' => $settings,] + $component)->save();
}

if (Drupal::moduleHandler()->moduleExists('user')) {
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['view xproduct']);
Expand Down

0 comments on commit 55855eb

Please sign in to comment.