Skip to content
Snippets Groups Projects
Commit ce802054 authored by Ilias Dimopoulos's avatar Ilias Dimopoulos
Browse files

Merge branch 'release/v1.90.3' into 'master'

Release v1.90.3

See merge request !89
parents e9cbf6e5 640c9cbc
No related branches found
Tags v1.90.3
1 merge request!89Release v1.90.3
......@@ -208,7 +208,7 @@ drupal:
];
// Location of the site configuration files.
$settings['config_sync_directory'] = '../config/sync';
$settings['config_readonly'] = FALSE; // !file_exists(getcwd() . '/../disable-config-readonly');
$settings['config_readonly'] = !file_exists(getcwd() . '/../disable-config-readonly');
Testing configuration alters: |
// The video from the home page interacts with Selenium tests.
$config['page_manager.page_variant.homepage-layout_builder-0']['variant_settings']['sections'][4]['components']['6ab0ceea-4541-4153-8b64-227e02369d30']['configuration']['text'] = 'Some joinup video';
......
......@@ -4,6 +4,7 @@
namespace Drupal\asset_distribution\Plugin\search_api\processor;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\File\FileUrlGeneratorInterface;
use Drupal\search_api\IndexInterface;
use Drupal\search_api\Item\ItemInterface;
......@@ -127,7 +128,14 @@ protected function appendDistributionData(ItemInterface $item): void {
$distributionFieldItemList = $distribution->get('field_ad_access_url');
if (!$distributionFieldItemList->isEmpty()) {
foreach ($distributionFieldItemList->referencedEntities() as $file) {
$sapiField->addValue($this->fileUrlGenerator->generateAbsoluteString($file->getFileUri()));
$file_url = $file->getFileUri();
if (UrlHelper::isExternal($file_url) && !UrlHelper::externalIsLocal($file_url, $GLOBALS['base_url'])) {
$url = $file_url;
}
else {
$url = $this->fileUrlGenerator->generateAbsoluteString($file->getFileUri());
}
$sapiField->addValue($url);
}
}
......
<?php
declare(strict_types = 1);
namespace Drupal\Tests\asset_distribution\ExistingSite;
use Drupal\Tests\joinup_test\ExistingSite\JoinupExistingSiteTestBase;
/**
* @covers \Drupal\asset_distribution\Plugin\search_api\processor\IndexDistributionData::appendDistributionData
* @group asset_distribution
*/
class SearchApiProcessorTest extends JoinupExistingSiteTestBase {
/**
* Tests that a file having ftp:// as scheme can be indexed.
*/
public function testFtpScheme(): void {
$solution = $this->createRdfEntity([
'rid' => 'solution',
'field_is_state' => 'validated',
'label' => $this->randomMachineName(),
// Ensure a parent collection.
'collection' => $this->createRdfEntity([
'rid' => 'collection',
'label' => $this->randomString(),
'field_ar_state' => 'validated',
]),
]);
$distribution = $this->createRdfEntity([
'rid' => 'asset_distribution',
'label' => $this->randomString(),
'og_audience' => $solution->id(),
'parent' => $solution,
'field_ad_access_url' => 'ftp://example.com',
]);
// Trigger indexing.
\Drupal::getContainer()->get('search_api.post_request_indexing')->destruct();
$this->assertSame('ftp://example.com', $distribution->get('field_ad_access_url')->target_id);
}
}
This diff is collapsed.
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