Problem/Motivation

The wse/current-workspace library is using jquery.once which is removed from Drupal 10. The library definition isn't declaring a corresponding library definition either.

Steps to reproduce

  • Install Drupal 10 and the wse module
  • In the active config, set wse.settings.append_current_workspace_to_url to true
  • Open any page with a form on it (except wse-workspace-preview-form)
  • Check the browser console for errors

Proposed resolution

  1. Depend on the core/once library
  2. Change the code in current-workspace.js accordingly

Issue fork wse-3404629

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

s_leu created an issue. See original summary.

s_leu’s picture

Issue summary: View changes

  • amateescu committed 4b6de468 on 1.0.x authored by s_leu
    Issue #3404629: Add dependency to core/once for current-workspace...
amateescu’s picture

Status: Active » Fixed

Merged into 1.0.x, thanks!

s_leu’s picture

Status: Fixed » Needs review

Need to re-open this. It seems the change we introduced here now adds the hidden form element on every form on the page which apparently wasn't the case before switching to the core/once library. Or at least it wasn't affecting the wse workspace switcher form prior to the changes in https://git.drupalcode.org/project/wse/-/commit/7cf8288e96fe36a39ff307898828a616039fa8c3#49ec2af778e7b50bf058e0bd30e4fde91e51e0da .

Anyway, the hidden element can't be added to the switcher form as it prevents switching the workspace from the select as it overrides the select's workspace_id in the submitted form values.

The new PR excludes the switcher form as well to fix this.

amateescu’s picture

Status: Needs review » Fixed

Merged the followup as well :)

Status: Fixed » Closed (fixed)

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