Skip to content

Commit

Permalink
VACMS-14955: Hide ief_reference_save button for CLP
Browse files Browse the repository at this point in the history
  • Loading branch information
Becapa committed Dec 29, 2023
1 parent ea93a35 commit 71c1a13
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docroot/modules/custom/va_gov_clp/va_gov_clp.module
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Contains va_gov_clp.module.
*/

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;

/**
Expand Down Expand Up @@ -49,3 +50,13 @@ function va_gov_clp_field_group_build_pre_render_alter(array &$variables) {
$variables['group_resources']['#access'] = FALSE;
}
}

/**
* Implements hook_inline_entity_form_reference_form_alter().
*/
function va_gov_clp_inline_entity_form_reference_form_alter(array &$reference_form, FormStateInterface &$form_state) {
// Hide save button when using entity browser.
if (!empty($reference_form['entity_browser'] && !empty($reference_form['actions']['ief_reference_save']))) {
$reference_form['actions']['ief_reference_save']['#attributes']['style'] = 'display: none;';
}
}

0 comments on commit 71c1a13

Please sign in to comment.