Add documentation Drupal.t() and other JS functions that cannot be aliased because they are scanned for in PHP

Created on 9 July 2017, over 8 years ago
Updated 8 October 2025, about 1 month ago

Problem/Motivation

In #2773601-25: Display "You are now in edit mode" prompt when user enters edit mode β†’ when we were attempting to use Javascript destructing on the Drupal object we were alerted to the fact that we cannot alias Drupal.t

This is because _locale_parse_js_file() on the php side scan Javascript files searching for Drupal.t() and other functions.

Proposed resolution

Add to the JSDoc for all these functions and explain they can't used with Destructing or other aliasing methods

Remaining tasks

patch

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

javascript

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

  • DrupalWTF

    Worse Than Failure. Approximates the unpleasant remark made by Drupal developers when they first encounter a particular (mis)feature.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024