Problem/Motivation

The 2.x -> 3.x update changed how custom tests work. I'm trying to sort out how to do custom tests with 3.x. I went to /admin/config/content/editoria11y and clicked on "injecting custom result JS events". It went to https://editoria11y.princeton.edu/configuration/#customtests which is a 404.

https://web.archive.org/web/20260121190327/https://editoria11y.princeton... is an old version of the page.

Steps to reproduce

Go to /admin/config/content/editoria11y and click on "injecting custom result JS events"

Environment details for bug reports

n/a

18 instances of this link

There are 18 instances of https://editoria11y.princeton.edu/configuration/#customtests in the module. FYI for updating the link or recreating the page.

Comments

nmillin created an issue. See original summary.

itmaybejj’s picture

Status: Active » Fixed

Oh dear. Thank you. I've put in a redirect at the old URL; the 2.x folks will need that forever even once I fix 3.x.

Here is the Drupal docs page with the new syntax.

The big changes are:

  1. How you "get" to the library now that it is an ESM module. The finders now look like Drupal.Ed11y.getElements('a[href*="safelinks.protection.outlook.com/?"]', 'root');
    and the tip titles get added to
    Drupal.ed11yLang.lang.testNames
  2. When you return a result, the content key should be an actual DOM node rather than a string. If you need to escape things, you can use Drupal.Ed11y.Lang.sprintf(`<div>HTML with an %arg</div>`, 'arg')

I recommend using this as your tip template:

<p></p> 
<p><strong class="badge">To fix</strong></p>
<div class="why"><div>

If you want a bug bounty credit for a year of CSA just ask.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

nmillin’s picture

Thanks for the quick instructions and pointing me in the right direction (I missed that page).

re: CSA credit
Thanks. I need to look into the CSA module and will reach out down the road.

nmillin’s picture

hmmm... I tried to follow https://editoria11y.com/en/install/#custom-tests and had a bad time (JS errors). I'm going to stick to the 2.x version for a bit and will come back to this once I get my sites to D11 (~a month). Thanks.

itmaybejj’s picture

OK. Well when you are ready to try again, swing by with the errors and the code and I'll help you troubleshoot. We have a bunch of custom tests in production here, so I don't expect it to take more than a tip or two, and might result in me putting some helpful updates in the documentation.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.