Problem/Motivation

Users are reporting Drupal 9 issues related to the DOMPurify library path in #3275787: DOMPurify library path. Initial inspection of the code reveals that the installation path uses the spelling "DOMPurify", but the libraries.yml file uses the spelling "dompurify". This may result in issues loading the DOMPurify library, and further investigation is required.

Steps to reproduce

TBD

Proposed resolution

TBD

Remaining tasks

  1. Determine whether there is indeed an issue.
  2. If there is an issue, update this description with steps to reproduce.

User interface changes

TBD

API changes

TBD - none likely

Data model changes

TBD - none likely

Comments

paulmckibben created an issue. See original summary.

paulmckibben’s picture

Status: Active » Closed (works as designed)

After installing DOMPurify using drush, even with the capitalization difference in the library path, the DOMPurify library was recognized, and HTML captions still displayed. There appears to be no issue with DOMPurify.

paulmckibben’s picture

Status: Closed (works as designed) » Needs work
Issue tags: +Needs tests

Going to reopen this to make sure DOMPurify is added to the test suite.

vfontaine’s picture

On a fresh install of Drupal 9.4.8 including the colorbox module, the DOMPurify library was not recognized.
It was installed at the following location :
/libraries/DOMPurify/dist/purify.min.js
Renaming to :
/libraries/dompurify/dist/purify.min.js
solved the problem.

cindyr’s picture

I just installed it on Drupal 9.4.8 and had the same issue. Renaming the folder as mentioned in #4 solved the problem.

donaldp’s picture

Same issue and resolution for me as #4.

bataboza’s picture

Solution from #4 works for me too on Drupal 9.4.8. And this is the case when Drupal is installed manually and Colorbox by Composer. Then the path sould be /libraries/dompurify/dist/purify.min.js

Otherwise, in case when Drupal is installed by Composer, as well as Colorbox, then the path should be /libraries/DOMPurify/dist/purify.min.js

portulaca’s picture

I have Drupal and Colorbox installed through Composer, only DOMPurify is manually copied into libraries/ folder, and renaming the folder to dompurify made the warning disappear.

bart lambert’s picture

same here like #4

pumpkinkid2’s picture

I'll throw my hat in the "#4 helped me also" ring.

flyke’s picture

Same, only recognized if the folder is renamed
from: libraries/DOMPurify
to: libraries/dompurify

thomaswalther’s picture

#4 worked for me (Drupal 10.2.1)

chike’s picture

#4 worked for me (Drupal 10.2.0)

sproets’s picture

On Drupal 11+ decapitalize the name tot dompurify still works, thanks!

karimbou’s picture

I had the issue for a long time, until checking the readme of colorbox, we basically need to enable dompurify with this command :
drush colorbox:dompurify
Then the warning and error to the path goes away.

But unlikely no configurations to be exported on this if you need to deploy to other environments, if you have a workaround to make it enabled easily ?