Skip to content
Snippets Groups Projects
Commit 420522d0 authored by Henrique Mendes's avatar Henrique Mendes Committed by Andrey Tymchuk
Browse files

Issue #3480057 by hmendes, walkingdexter: Image support for Paragraph Library

parent 66b46a9c
No related branches found
No related tags found
1 merge request!109Adding support for paragraph library
Pipeline #307487 passed
......@@ -20,7 +20,10 @@
"require": {
"ext-xmlwriter": "*"
},
"conflict": {
"drush/drush": "<12.5.1"
}
"require-dev": {
"drupal/paragraphs": "^1.18"
},
"conflict": {
"drush/drush": "<12.5.1"
}
}
......@@ -9,8 +9,6 @@ parameters:
ignoreErrors:
# new static() is a best practice in Drupal, so we cannot fix that.
- "#^Unsafe usage of new static#"
# The paragraphs module is not required.
- '#^Class Drupal\\paragraphs\\ParagraphInterface not found\.$#'
# See https://www.drupal.org/project/simple_sitemap/issues/3344735
- message: '#^Variable \$path on left side of \?\? always exists and is not nullable\.$#'
paths:
......
......@@ -12,6 +12,7 @@ use Drupal\Core\Url;
use Drupal\file\FileInterface;
use Drupal\media\MediaInterface;
use Drupal\paragraphs\ParagraphInterface;
use Drupal\paragraphs_library\LibraryItemInterface;
use Drupal\simple_sitemap\Entity\EntityHelper;
use Drupal\simple_sitemap\Exception\SkipElementException;
use Drupal\simple_sitemap\Logger;
......@@ -287,7 +288,7 @@ abstract class EntityUrlGeneratorBase extends UrlGeneratorBase {
];
}
}
elseif ($item->entity instanceof MediaInterface || $item->entity instanceof ParagraphInterface) {
elseif ($item->entity instanceof MediaInterface || $item->entity instanceof ParagraphInterface || $item->entity instanceof LibraryItemInterface) {
$image_data = array_merge($image_data, $this->getEntityImageData($item->entity));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment