Skip to content

hooks no longer seem to work as doc'ed #3351

@delocalizer

Description

@delocalizer

Describe the bug or behavior
I'm trying to implement a hook in js as described here hooks.md

To Reproduce
Steps to reproduce the behavior:

  1. Create the hook file foo.js
  2. Reference it in config via :extra-scripts
  3. Start services, open the JS console in the browser, and perform any UI action in REMS
  4. foo.js throws an error stating that rems.hooks is undefined:

image of JS console showing a red cross with text Uncaught TypeError: Cannot read properties of undefined (reading 'hooks)

Expected behavior
This used to work, prior to d436777, which removed the inline JS initialization of the hooks.

If I revert back to 2f3321e and build, the exact hook example file in the documentation works as expected.
So I'm not sure if this is a bug in the documentation because hooks actually work a different way now, or a bug in the current hook implementation.

Environment

  • Version of REMS: v2.37
  • OS: Fedora Linux fc40
  • Browser: Chrome 131.0.6778.33

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Accepted

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions