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

[SD-416] Fixes placeholder issue for Header links #542

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ label: Title
description: ''
required: true
translatable: true
default_value:
-
value: 'Want to know more about...'
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
11 changes: 10 additions & 1 deletion modules/tide_landing_page/tide_landing_page.install
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function tide_landing_page_update_10106() {
$form_configs = [
'field.field.node.landing_page.field_landing_page_component',
];
/** @var \Drupal\tide_core\TideEntityUpdateHelper $s */
/** @var \Drupal\tide_core\TideEntityUpdateHelper $tide_update_helper */
$tide_update_helper = \Drupal::service('tide_core.entity_update_helper');
$tide_update_helper->configMergeDeep('tide_landing_page', TideEntityUpdateHelper::INSTALL_DIR, $form_configs);
$result = $tide_update_helper->updateFromOptional('base_field_override', 'paragraphs_library_item.paragraphs_library_item.paragraphs');
Expand All @@ -194,3 +194,12 @@ function tide_landing_page_update_10106() {
}

}

/**
* Update key_journeys.field_paragraph_title configs.
*/
function tide_landing_page_update_10107() {
/** @var \Drupal\tide_core\TideEntityUpdateHelper $tide_update_helper */
$tide_update_helper = \Drupal::service('tide_core.entity_update_helper');
$tide_update_helper->revert('field_config', 'paragraph.key_journeys.field_paragraph_title');
}
6 changes: 2 additions & 4 deletions modules/tide_landing_page/tide_landing_page.module
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ function tide_landing_page_form_node_form_alter(&$form, FormStateInterface $form
if (isset($form['title']['widget'][0]['value']['#description'])) {
$form['title']['widget'][0]['value']['#description'] = t('Include a short unique title for your page and keywords.');
}
if (isset($form["field_landing_page_key_journeys"]["widget"][0]["subform"]["field_paragraph_title"]["widget"][0]["value"]["#default_value"])) {
$placeholder_value = $form["field_landing_page_key_journeys"]["widget"][0]["subform"]["field_paragraph_title"]["widget"][0]["value"]["#default_value"];
$form["field_landing_page_key_journeys"]["widget"][0]["subform"]["field_paragraph_title"]["widget"][0]["value"]["#placeholder"] = $placeholder_value;
unset($form["field_landing_page_key_journeys"]["widget"][0]["subform"]["field_paragraph_title"]["widget"][0]["value"]["#default_value"]);
if (isset($form['field_landing_page_key_journeys']['widget'][0]['subform']['field_paragraph_title']['widget'][0])) {
$form['field_landing_page_key_journeys']['widget'][0]['subform']['field_paragraph_title']['widget'][0]['value']['#placeholder'] = t("Want to know more about...");
}
// Change form layout.
$form['#attached']['library'][] = 'tide_landing_page/landing_page_form';
Expand Down
Loading