joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.73k stars 3.65k forks source link

J4.4 Codemirror - paths to modes (syntax) not always correct #43664

Open ahrhuzen opened 2 months ago

ahrhuzen commented 2 months ago

Steps to reproduce the issue

In the XML-file of, for example, a module you can use the field type editor with editor codemirror.

Add a field to the XML using the syntax for css. For example:

<field name="css-code" label="CSS Code" type="editor" editor="codemirror" syntax="css" /> 

Expected result

A codemirror textarea that checks to code according to the chosen syntax. In this example: css

Actual result

The syntax check is not implemented because the syntax files could not be found. This can be seen in the inspect window of the browser.

The Joomla-code / Codemirror-code (I don't know which) looks for the syntax file at (let's call it location A): /media/vendor/codemirror/mode/text/css/text/css.min.js

The syntax code is located at (location B): /media/vendor/codemirror/mode/css/css.min.js

Result the relevant syntax code is not found: there is something wrong with the path.

System information (as much as possible)

Joomla 4.4.5 on a windows 2019 server.

Additional comments

For the syntax php everything is allright. For the syntax of css, js and sql it is not. Other syntaxes not tested.

JS: Location A: /domains/de4a.nl/public_html/media/vendor/codemirror/mode/text/javascript/text/javascript.min.js Location B: /domains/de4a.nl/public_html/media/vendor/codemirror/mode/javascript/javascript.min.js

SQL (just a little more wrong): Location A: /domains/de4a.nl/public_html/media/vendor/codemirror/mode/text/x-sql/text/x-sql.min.js Location B: /domains/de4a.nl/public_html/media/vendor/codemirror/mode/sql/sql.min.js

Quick fix Copy the relevant files from location B to location A

brianteeman commented 1 month ago

Tested with syntax="php" syntax="js" syntax="css" syntax=sql"

In all cases no errors were reported in the console and the reported bug could not be replicated

I note that you say you are running a windows2019 server - perhaps that is the problem (clutching at straws)

ahrhuzen commented 1 month ago

Hi Brian,

Thank you for taking the time to have a look at my bug-report. Just this week, while fixing this bug on my development environment on my Mac, I wondered if my bug would be looked at. So, thank you again. I wil take some time next week to create a few screen shots, to show you in more detail, what I think is the matter.

For now, have a good weekend.

Regards,

Arend-Henk Huzen

Op 1 aug 2024, om 14:45 heeft Brian Teeman @.***> het volgende geschreven:

Tested with syntax="php" syntax="js" syntax="css" syntax=sql"

In all cases no errors were reported in the console and the reported bug could not be replicated

I note that you say you are running a windows2019 server - perhaps that is the problem (clutching at straws)

— Reply to this email directly, view it on GitHub https://github.com/joomla/joomla-cms/issues/43664#issuecomment-2262951080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIQ3OKHE6JFU5ZIN7XKJUWLZPIUXRAVCNFSM6AAAAABJNYMDYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRSHE2TCMBYGA. You are receiving this because you authored the thread.

ahrhuzen commented 1 month ago

I had a second look at the issue I raised. I made a very simple module to illustrate my point: four xml-settings with different. Only the format checker for PHP works without the quick fix I already mentioned.

Situation before quick fix I get three error-messages

Error-messages

With this folder-structure:

Folder-structure before

After I renamed the folder 'text-renamed' back to 'text' (applying the quick fix), there are no error-messages.

Folder-structure after

Test Module mod_jm_test.zip

brianteeman commented 1 month ago

I just did a quick install and didnt get those errors Then I checked again and noticed that I tested in j5 and this report is for j4 On J4 I do get those errors