Unverified Commit c13c1294 authored by Christian Fritsch's avatar Christian Fritsch Committed by GitHub
Browse files

Issue #3296109: Compatibility with Drupal 10



* Drupal 10 readiness

* Remove ckeditor test

* disable paratest

* Use ck5

* Fixing

* Fix ckeditor tests

* Try

* Refactor js

* Add semicolon

Co-authored-by: default avatarChristian Fritsch <christian.fritsch@burda.com>
parent f42af37a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ jobs:
    strategy:
      matrix:
        THEME: ['claro', 'gin']
        DRUPAL_TESTING_DRUPAL_VERSION: ['~9.4.0']
        DRUPAL_TESTING_DRUPAL_VERSION: ['~9.4.0', '~10.0.0']
        PHP_VERSION: ['8.1']

    steps:
@@ -65,7 +65,7 @@ jobs:

    - name: Test for deprecations
      run: test-drupal-project deprecation
      if: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION != '~9.1.0' }}
      if: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION != '~10.0.0' }}

    - name: Install drupal
      run: test-drupal-project install
+14 −13
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Paragraphs actions JS code for paragraphs actions button.
 */

(function ($, Drupal) {
(function ($, Drupal, once) {

  'use strict';

@@ -99,8 +99,8 @@
   */
  Drupal.behaviors.paragraphsFeaturesDeleteConfirmationInit = {
    attach: function (context, settings) {
      var $actions = $(context).find('.paragraphs-actions').once('paragraphs-features-delete-confirmation-init');
      $actions.find('*[data-drupal-selector*="remove"]').each(function () {
      once('paragraphs-features-delete-confirmation-init', '.paragraphs-actions', context).forEach((actions) => {
        $(actions).find('*[data-drupal-selector*="remove"]').each(function () {
          // Add custom button element and handler.
          var $element = $(Drupal.theme('paragraphsFeaturesDeleteConfirmationButton', {class: $(this).attr('class')})).insertBefore(this);
          $element.bind('mousedown', Drupal.paragraphs_features.deleteConfirmHandler());
@@ -111,6 +111,7 @@
          // Hide original Button
          $(this).wrap('<div class="visually-hidden"></div>');
        });
      });
    }
  };
}(jQuery, Drupal));
}(jQuery, Drupal, once));
+1 −1
Original line number Diff line number Diff line
name: 'Paragraphs Features'
type: module
description: 'Provides additional paragraphs widgets.'
core_version_requirement: ^9.2
core_version_requirement: ^9.2 || ^10
package: Paragraphs
configure: paragraphs_features.settings_form
dependencies:
+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ delete_confirmation:
      css/paragraphs-features.delete-confirmation.css: {}
  dependencies:
    - core/drupal
    - core/jquery.once
    - core/jquery
    - core/once

widget:
  css:
+5 −5
Original line number Diff line number Diff line
@@ -13,9 +13,9 @@ use Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget;
use Drupal\paragraphs_features\ParagraphsFeatures;

/**
 * Implements hook_field_widget_multivalue_form_alter().
 * Implements hook_field_widget_complete_form_alter().
 */
function paragraphs_features_field_widget_multivalue_form_alter(array &$elements, FormStateInterface $form_state, array $context) {
function paragraphs_features_field_widget_complete_form_alter(&$field_widget_complete_form, FormStateInterface $form_state, $context) {
  /** @var \Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget $widget */
  $widget = $context['widget'];
  if (!($widget instanceof ParagraphsWidget)) {
@@ -23,9 +23,9 @@ function paragraphs_features_field_widget_multivalue_form_alter(array &$elements
  }

  // For compatibility with Drag & Drop in Paragraphs.
  if (!empty($elements['#field_name'])) {
    $fieldWrapperId = ParagraphsFeatures::getWrapperId($context['form']['#parents'], $elements['#field_name']);
    ParagraphsFeatures::registerFormWidgetFeatures($elements, $widget, $fieldWrapperId);
  if (!empty($field_widget_complete_form['widget']['#field_name'])) {
    $fieldWrapperId = ParagraphsFeatures::getWrapperId($context['form']['#parents'], $field_widget_complete_form['widget']['#field_name']);
    ParagraphsFeatures::registerFormWidgetFeatures($field_widget_complete_form['widget'], $widget, $fieldWrapperId);
  }
}

Loading