Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahrhuzen opened this issue Jun 17, 2024 · 2 comments
Open

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

ahrhuzen opened this issue Jun 17, 2024 · 2 comments

Comments

@ahrhuzen
Copy link

ahrhuzen commented Jun 17, 2024

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
Copy link
Contributor

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
Copy link
Author

ahrhuzen commented Aug 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants