Skip to content
Snippets Groups Projects
Commit 21068f03 authored by Lucas Hedding's avatar Lucas Hedding
Browse files

Issue #3493426 by heddn, jeff.hartman: Module cannot be installed due to dot...

Issue #3493426 by heddn, jeff.hartman: Module cannot be installed due to dot in cache.serializer_path key
parent dd8219b0
No related branches found
No related tags found
1 merge request!8#3493426: Module cannot be installed due to dot in cache.serializer_path key
Pipeline #366906 passed
cache.serializer_path: ''
cache_serializer_path: ''
......@@ -9,6 +9,6 @@ htmlpurifier.settings:
type: config_object
label: 'HTML Purifier settings'
mapping:
cache.serializer_path:
cache_serializer_path:
type: string
label: 'Absolute path with no trailing slash to store serialized definitions.'
......@@ -3,3 +3,5 @@ type: module
description: 'Filter that removes malicious HTML and ensures standards compliant output.'
package: Filter
core_version_requirement: ^10.2 || ^11
dependencies:
drupal:filter
......@@ -67,7 +67,7 @@ class HtmlPurifierFilter extends FilterBase implements ContainerFactoryPluginInt
}
// Set Serializer path to the temporary directory, so it can be written.
$cache_serializer_path = $this->configFactory->get('htmlpurifier.settings')->get('cache.serializer_path');
$cache_serializer_path = $this->configFactory->get('htmlpurifier.settings')->get('cache_serializer_path');
if (empty($cache_serializer_path)) {
$cache_serializer_path = $this->fileSystem->getTempDirectory() . '/htmlpurifier';
}
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\htmlpurifier\Functional;
use Drupal\Component\Serialization\Yaml;
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\Group;
/**
* Test html purifier module.
*/
#[Group('htmlpurifier')]
final class HtmlPurifierTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'claro';
/**
* {@inheritdoc}
*/
protected static $modules = [
'filter',
'filter_test',
'htmlpurifier',
];
/**
* Test module configuration and setup.
*/
public function testConfiguration(): void {
$purifier_config = \HTMLPurifier_Config::createDefault();
$default_configuration = Yaml::encode($purifier_config->getAll());
$full_html_format = FilterFormat::load('full_html');
assert($full_html_format instanceof FilterFormat);
$filters = $full_html_format->get('filters');
$filters['htmlpurifier'] = [
'status' => TRUE,
'settings' => [
'htmlpurifier_configuration' => $default_configuration,
],
];
$full_html_format->set('filters', $filters)
->save();
$adminUser = $this->drupalCreateUser([
'administer filters',
$full_html_format->getPermissionName(),
]);
$this->drupalLogin($adminUser);
$this->drupalGet('/admin/config/content/formats/manage/full_html');
$this->assertSession()->pageTextContains('HTML Purifier Configuration');
}
}
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