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

Issue #3480341 by hmendes, walkingdexter: Include images settings on custom links not working

parent 420522d0
No related branches found
No related tags found
1 merge request!110Fixing includeImages settings for custom links
Pipeline #311776 passed
......@@ -43,13 +43,6 @@ class CustomUrlGenerator extends EntityUrlGeneratorBase {
*/
protected $pathValidator;
/**
* Include images of custom links.
*
* @var bool
*/
protected $includeImages;
/**
* CustomUrlGenerator constructor.
*
......@@ -127,8 +120,6 @@ class CustomUrlGenerator extends EntityUrlGeneratorBase {
* {@inheritdoc}
*/
public function getDataSets(): array {
$this->includeImages = $this->settings->get('custom_links_include_images', FALSE);
$custom_link_settings = $this->customLinks->setSitemaps($this->sitemap)->get();
$custom_link_settings = $custom_link_settings ? reset($custom_link_settings) : [];
......@@ -153,6 +144,7 @@ class CustomUrlGenerator extends EntityUrlGeneratorBase {
$url_object = Url::fromUserInput($data_set['path'])->setAbsolute();
$entity = $this->entityHelper->getEntityFromUrlObject($url_object);
$include_images = $this->settings->get('custom_links_include_images', FALSE);
$path_data = [
'url' => $url_object,
......@@ -161,7 +153,7 @@ class CustomUrlGenerator extends EntityUrlGeneratorBase {
: NULL,
'priority' => $data_set['priority'] ?? NULL,
'changefreq' => !empty($data_set['changefreq']) ? $data_set['changefreq'] : NULL,
'images' => $this->includeImages && !empty($entity) && $entity instanceof ContentEntityInterface
'images' => $include_images && !empty($entity) && $entity instanceof ContentEntityInterface
? $this->getEntityImageData($entity)
: [],
'meta' => [
......
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