? NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar OctavianC
OctavianC
23 Nov 2022

Pull Request for Issue #33542 .

Summary of Changes

When fixing #39277 this bug resurfaced...
Special handling for text/html to set the editor mode to mode.mode which is htmlmixed. Inspired from the x-php handling... I'm not familiar with how CodeMirror loads modes and why a second instance of the HTML mode would attempt to load "text/html.js" instead of "htmlmixed.js" (the parameters are the same) but this seems to do the trick.

Testing Instructions

  • Set CodeMirror as default editor
  • Go to Content - Fields - click New
  • Set Type to Editor, add a Title and Save
  • Go to Content - Articles - click New. You'll see the main content editor on the first tab and another CodeMirror editor in the Fields tab.

Actual result BEFORE applying this Pull Request

Second editor instance attempts to load text/html.js which results in a 404 Not Found
image

Expected result AFTER applying this Pull Request

No errors in the console
image

Make sure other instances are not affected: I've verified that highlighting works correctly for .css, .json, .xml, .php files when using the editor from Site Templates > Cassiopeia

avatar OctavianC OctavianC - open - 23 Nov 2022
avatar OctavianC OctavianC - change - 23 Nov 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Nov 2022
Category JavaScript Repository NPM Change
avatar OctavianC OctavianC - change - 23 Nov 2022
Labels Added: NPM Resource Changed ?
avatar brianteeman brianteeman - test_item - 23 Nov 2022 - Tested successfully
avatar brianteeman
brianteeman - comment - 23 Nov 2022

I have tested this item successfully on 86e8d3e

Replicated bug and confirmed the fix


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39295.

avatar richard67
richard67 - comment - 23 Nov 2022

Why not just adding ‘text/html’ to the array in line 64 instead of adding the elseif?

avatar richard67
richard67 - comment - 23 Nov 2022

Why not just adding ‘text/html’ to the array in line 64 instead of adding the elseif?

Ah, forget it. Silly me. Haven’t looked close enough on my phone :-)

avatar viocassel viocassel - test_item - 24 Nov 2022 - Tested successfully
avatar viocassel
viocassel - comment - 24 Nov 2022

I have tested this item successfully on 86e8d3e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39295.

avatar richard67 richard67 - change - 24 Nov 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 24 Nov 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39295.

avatar laoneo laoneo - change - 24 Nov 2022
Labels Added: ?
avatar laoneo laoneo - change - 25 Nov 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-11-25 08:11:35
Closed_By laoneo
avatar laoneo laoneo - close - 25 Nov 2022
avatar laoneo laoneo - merge - 25 Nov 2022
avatar laoneo
laoneo - comment - 25 Nov 2022

Thanks!

Add a Comment

Login with GitHub to post a comment