Commit 8755c5b8 authored by Alex Pott's avatar Alex Pott Committed by Sascha Grossenbacher
Browse files

Issue #3253545 by alexpott, chr.fritsch: Drupal 9.3 fixes and PHP 8.1

parent 0cbc5624
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,6 +18,6 @@
    "drupal/ctools": "3.x-dev",
    "drupal/entity_browser": "2.x-dev",
    "drupal/entity_usage": "2.x-dev",
    "drupal/search_api": "~1.0"
    "drupal/search_api": "1.x-dev"
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -740,7 +740,7 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
        return '';
      }

      $text = $this->get($field_name)->value;
      $text = $this->get($field_name)->value ?? '';
      $summary = Unicode::truncate(trim(strip_tags($text)), 150);
      if (empty($summary)) {
        // Autoescape is applied to the summary when it is rendered with twig,
+6 −4
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ class ParagraphsType extends ConfigEntityBundleBase implements ParagraphsTypeInt
      // Compose the default icon file destination.
      $icon_meta = stream_get_meta_data($icon_data);
      // File extension from MIME, only JPG/JPEG, PNG and SVG expected.
      list(, $icon_file_ext) = explode('image/', $icon_meta['mediatype']);
      [, $icon_file_ext] = explode('image/', $icon_meta['mediatype']);
      // SVG special case.
      if ($icon_file_ext == 'svg+xml') {
        $icon_file_ext = 'svg';
@@ -159,10 +159,12 @@ class ParagraphsType extends ConfigEntityBundleBase implements ParagraphsTypeInt
   * {@inheritdoc}
   */
  public function getIconFile() {
    if ($this->icon_uuid !== NULL) {
      $icon = $this->getFileByUuid($this->icon_uuid) ?: $this->restoreDefaultIcon();
    if ($this->icon_uuid && $icon) {
      if ($icon) {
        return $icon;
      }
    }

    return FALSE;
  }
+2 −2
Original line number Diff line number Diff line
@@ -1049,7 +1049,7 @@ class ParagraphsWidget extends WidgetBase {
    $is_multiple = $this->fieldDefinition->getFieldStorageDefinition()->isMultiple();

    $field_title = $this->fieldDefinition->getLabel();
    $description = FieldFilteredMarkup::create(\Drupal::token()->replace($this->fieldDefinition->getDescription()));
    $description = FieldFilteredMarkup::create(\Drupal::token()->replace($this->fieldDefinition->getDescription() ?? ''));

    $elements = array();
    $tabs = '';
@@ -1781,7 +1781,7 @@ class ParagraphsWidget extends WidgetBase {
    }

    // Add information into delta mapping for the new element.
    $original_deltas_size = count($widget_state['original_deltas']);
    $original_deltas_size = count($widget_state['original_deltas'] ?? []);
    $new_original_deltas[$new_delta] = $original_deltas_size;
    $user_input[$original_deltas_size]['_weight'] = $new_delta;

+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class FieldCollectionFieldInstanceSettings extends ProcessPluginBase {
    if ($type == 'field_collection') {
      $bundles = $this->entityTypeBundleInfo->getBundleInfo('paragraph');

      $target_bundle = $row->getSourceProperty('field_name');
      $target_bundle = $row->getSourceProperty('field_name') ?? '';
      // Remove field_ prefix for new bundle.
      $target_bundle = substr($target_bundle, FieldCollection::FIELD_COLLECTION_PREFIX_LENGTH);

Loading