Skip to content
Open
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
3 changes: 3 additions & 0 deletions changelogs/DP-46271.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed:
- description: Fix press release city injection to use the first paragraph even when the first p tag has attributes like lang.
issue: DP-46271
7 changes: 2 additions & 5 deletions docroot/themes/custom/mass_theme/mass_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -3497,11 +3497,8 @@ function mass_theme_preprocess_node_news_full(&$variables) {
$location = Helper::fieldFullView($node, $field['location']);
$location_string = \Drupal::service('renderer')->renderRoot($location);
$location = '<span class="ma__rich-text__flame">' . $location_string . '</span> &mdash; ';
$body_array = explode('<p>', $body_string);
if (count($body_array) > 1) {
$body_array[1] = $location . $body_array[1];
}
$body_string = implode('<p>', $body_array);
// Prefix the first paragraph content, regardless of attributes like lang.
$body_string = preg_replace('/(<\s*p\b[^>]*>)/i', '$1' . $location, $body_string, 1);
}
if (Helper::fieldValue($node, $field['news_type']) == 'press_release') {
$ap_conformity = TRUE;
Expand Down