Skip to content

Fixed bulk attribute update toggleFieldEditMode crash#620

Merged
fballiano merged 5 commits intomainfrom
fix/bulk-attribute-toggle-crash
Mar 4, 2026
Merged

Fixed bulk attribute update toggleFieldEditMode crash#620
fballiano merged 5 commits intomainfrom
fix/bulk-attribute-toggle-crash

Conversation

@fballiano
Copy link
Contributor

Fixes #614

Summary

  • Fixed toogleFieldEditMode() crashing when the onclick handler passes this (a DOM element) instead of a string ID — document.getElementById() returned null, causing "Cannot read properties of null (reading 'checked')"
  • The function now accepts both DOM elements and string IDs via an instanceof HTMLElement check
  • Corrected the typo in the function name (toogletoggle) and kept a deprecated wrapper for backwards compatibility

Test plan

  • Admin → Catalog → Manage Products → select products → Actions: Update Attributes
  • Click "Change" checkboxes next to attributes — fields should enable/disable without JS errors
  • Verify no console errors appear

The onclick handler passed `this` (a DOM element) to toogleFieldEditMode(),
but the function called document.getElementById() on it, expecting a string,
which returned null and threw "Cannot read properties of null".

Fix the function to accept both DOM elements and string IDs, correct the
typo in the function name, and keep a deprecated wrapper for backwards
compatibility.
@fballiano fballiano changed the title Fixed bulk attribute update toggleFieldEditMode crash Fixed bulk attribute update toggleFieldEditMode crash Mar 4, 2026
@fballiano fballiano merged commit b26ec35 into main Mar 4, 2026
24 checks passed
@fballiano fballiano deleted the fix/bulk-attribute-toggle-crash branch March 4, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bulk attribute update: toogleFieldEditMode crashes when checkbox is clicked

1 participant