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

UHF-9113 Drupal10 bug fixes #630

Merged
merged 5 commits into from
Nov 2, 2023
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
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"drupal/external_entities": "^2.0@alpha",
"drupal/field_group": "^3.1",
"drupal/focal_point": "^2.0",
"drupal/gin_toolbar": "^1.0",
"drupal/gin_toolbar": "^1.0@rc",
"drupal/helfi_api_base": "*",
"drupal/helfi_tpr": "*",
"drupal/image_style_quality": "^1.4",
Expand Down Expand Up @@ -89,7 +89,8 @@
"[#UHF-2059] Enhancements for the Admin UI": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/fdccb32397cc6fa19b4d0077b21a2b18aa6be297/patches/helfi_customizations_for_paragraphs_widget_8.x-1.12.patch"
},
"drupal/publication_date": {
"[#UHF-7721] Fixed node preview when publication date is not set. (https://www.drupal.org/project/publication_date/issues/3074373)": "https://www.drupal.org/files/issues/2022-12-20/publication_date_is_required_for_completing_the_form-3074373-11.patch"
"[#UHF-7721] Fixed node preview when publication date is not set. (https://www.drupal.org/i/3074373)": "https://www.drupal.org/files/issues/2022-12-20/publication_date_is_required_for_completing_the_form-3074373-11.patch",
"[#UHF-9113] Fix PHP 8.2 deprecation issue with PublishedAtOrNowComputed class. (https://www.drupal.org/i/3328575)": "https://www.drupal.org/files/issues/2023-05-31/3328575-5-fix-bux-publicate-date.patch"
},
"drupal/social_media": {
"Add missing schema to social media. (https://www.drupal.org/project/social_media/issues/2986819)": "https://git.drupalcode.org/project/social_media/-/commit/1964f42e5a6fb5d7a97fdf8ec5ca259bc6c5b19a.patch"
Expand Down
15 changes: 0 additions & 15 deletions modules/helfi_ckeditor/assets/js/handleFigcaptionSourceOrder.js

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ settings:
- '<h4 id>'
- '<h5 id>'
- '<h6 id>'
- '<figure class tabindex>'
- '<figure tabindex>'
- '<figcaption>'
ckeditor5_list:
reversed: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ filters:
status: true
weight: -50
settings:
allowed_html: '<br> <p data-helfi-quote-text> <h2> <h3> <h4> <h5> <h6> <blockquote role aria-* cite class data-helfi-quote> <div role aria-* class> <span role aria-* class dir> <ul type> <ol type start> <figure class tabindex> <figcaption> <strong> <em> <s> <sub> <sup> <a href data-entity-type data-entity-uuid data-entity-substitution aria-label class data-design data-hds-icon-start data-is-external data-link-text data-protocol data-selected-icon data-hds-component data-hds-variant rel role target="_blank"> <li> <table> <tr> <td rowspan colspan> <th rowspan colspan> <thead> <tbody> <tfoot> <caption> <footer data-helfi-quote-author> <cite>'
allowed_html: '<br> <p data-helfi-quote-text> <h2> <h3> <h4> <h5> <h6> <blockquote role aria-* cite class data-helfi-quote> <div role aria-* class> <span role aria-* class dir> <ul type> <ol type start> <figure tabindex> <figcaption> <strong> <em> <s> <sub> <sup> <a href data-entity-type data-entity-uuid data-entity-substitution aria-label class data-design data-hds-icon-start data-is-external data-link-text data-protocol data-selected-icon data-hds-component data-hds-variant rel role target="_blank"> <li> <table> <tr> <td rowspan colspan> <th rowspan colspan> <thead> <tbody> <tfoot> <caption> <footer data-helfi-quote-author> <cite>'
filter_html_help: true
filter_html_nofollow: false
filter_htmlcorrector:
Expand Down
2 changes: 1 addition & 1 deletion modules/helfi_ckeditor/helfi_ckeditor.install
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function helfi_ckeditor_update_9002(): void {
"REGEXP_REPLACE($column, :pattern, :replacement)",
[':pattern' => $regex, ':replacement' => $replacement]
);
$result = $update->execute();
$update->execute();
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions modules/helfi_ckeditor/helfi_ckeditor.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,3 @@ helfi_table:
assets/js/build/helfiTable.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5

# Helfi Table CKEditor5 plugin JavaScript and CSS.
helfi_table_figcaption:
version: 1.0.0
js:
assets/js/handleFigcaptionSourceOrder.min.js: {}
dependencies:
- core/drupal
- core/once
30 changes: 0 additions & 30 deletions modules/helfi_ckeditor/helfi_ckeditor.module
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
declare(strict_types = 1);

use Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition;
use Drupal\Core\Field\FieldItemListInterface;

/**
* Modify the list of available CKEditor 5 plugins.
Expand All @@ -32,32 +31,3 @@ function helfi_ckeditor_ckeditor5_plugin_info_alter(array &$plugin_definitions):
// Save ckeditor5_table plugin definitions.
$plugin_definitions['ckeditor5_table'] = new CKEditor5PluginDefinition($original_table_plugin);
}

/**
* Add figcaption source order javascript library to each HTML text format.
*/
function helfi_ckeditor_preprocess_field(array &$variables): void {
// Handle only fields of type "text_long".
if (
!array_key_exists('field_type', $variables) ||
$variables['field_type'] !== 'text_long' ||
!array_key_exists('element', $variables) ||
!array_key_exists('#items', $variables['element'])
) {
return;
}

/** @var \Drupal\Core\Field\FieldItemListInterface $fieldItems */
$fieldItems = &$variables['element']['#items'];

// Handle only fields which has full_html as their text format.
if (
!$fieldItems instanceof FieldItemListInterface ||
$fieldItems->first()?->get('format')?->getValue() !== 'full_html'
) {
return;
}

// Add the figcaption source order handler JS to current field.
$variables['#attached']['library'][] = 'helfi_ckeditor/helfi_table_figcaption';
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ use Drupal\helfi_media_remote_video\Entity\RemoteVideo;
use Drupal\media\OEmbed\Resource;
use Drupal\media\OEmbed\ResourceException;

const HELFI_MEDIA_REMOTE_VIDEO_HELSINKI_KANAVA_URL_PATTERN = 'https://www.helsinkikanava.fi/*/web/helsinkikanava/player/vod?assetId=*';

/**
* Implements hook_media_source_info_alter().
*/
Expand Down Expand Up @@ -174,6 +172,7 @@ function _helfi_media_remote_video_remote_video_url_handler(string $video_url):
$converted_url = FALSE;
$url_resolver = \Drupal::service('media.oembed.url_resolver');
$provider = $url_resolver->getProviderByUrl($video_url);
$helsinki_kanava_url_pattern = 'https://www.helsinkikanava.fi/*/web/helsinkikanava/player/vod?assetId=*';

// Handle only Helsinki-kanava videos (Icareus Suite).
if ($provider->getName() !== 'Icareus Suite') {
Expand All @@ -192,7 +191,7 @@ function _helfi_media_remote_video_remote_video_url_handler(string $video_url):
}

$lang_code = empty($lang_code) ? 'fi' : $lang_code;
$url_parts = explode('*', HELFI_MEDIA_REMOTE_VIDEO_HELSINKI_KANAVA_URL_PATTERN);
$url_parts = explode('*', $helsinki_kanava_url_pattern);
$converted_url = $url_parts[0] . $lang_code . $url_parts[1] . $asset_id;
}

Expand All @@ -207,7 +206,7 @@ function _helfi_media_remote_video_remote_video_url_handler(string $video_url):
}

$lang_code = empty($lang_code) ? 'fi' : $lang_code;
$url_parts = explode('*', HELFI_MEDIA_REMOTE_VIDEO_HELSINKI_KANAVA_URL_PATTERN);
$url_parts = explode('*', $helsinki_kanava_url_pattern);
$converted_url = $url_parts[0] . $lang_code . $url_parts[1] . $asset_id;
}

Expand Down
Loading