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

Fix the Markdown editor's implicit dependency on Media #17348

Open
pbull001 opened this issue Jan 14, 2025 · 17 comments
Open

Fix the Markdown editor's implicit dependency on Media #17348

pbull001 opened this issue Jan 14, 2025 · 17 comments

Comments

@pbull001
Copy link

pbull001 commented Jan 14, 2025

See #17348 (comment) below.

Describe the bug

I have created a ContentType that uses a MarkdownBodyPart. When I edit it using the "Content Items" list in Contents module the WYSIWG editor does not initiated. I can edit the content and it rendered correctly when displaed. It is just the editor in the Edit view that is the issue.

Only occurs when site hosted on Azure Web App (windows). DOES NOT occur when run locally in debug mode

Orchard Core version

OC 2.1.3

image

To Reproduce

Azure Hosted WebApp

Using OC 2.1.3

Content Type Definition

  • Create new ContentType
  • Add MarkdownBodyPart
  • Set Editor to WYSIWG

Go to Dashboard - ContentItems
Create new instance of type with MarkdownBodyPart

Issue - editor not rendering.
image

Note: Issue does not occuring when I run locally.

Expected behavior

Logs and screenshots

@pbull001
Copy link
Author

Expect Behaviour

@pbull001
Copy link
Author

image

@Piedone
Copy link
Member

Piedone commented Jan 14, 2025

What do you see in the browser and OC logs? Is the screenshot with the package references that of your web app's?

@pbull001
Copy link
Author

Screenshot with "Edit MDT2" is what I am seeing where was expecting the screenshot with "Edit MDT"

Package references are my project references (just following template :) )

Log is not providing clues (thank you for the "media" error feedback).
oclog.txt

@pbull001
Copy link
Author

When I edit on instance hosted on Azure I get the follow error logged to Console:

image

Associated iissue:
image

@Piedone
Copy link
Member

Piedone commented Jan 15, 2025

I mean, the screenshot with the package references, is that from the root web app of your solution? Because if it is, then you don't need any other OrchardCore.* package there except for OrchardCore.Application.Cms.Targets and OrchardCore.Logging.NLog. This is not the cause of the issue, just FYI.

The browser log shows that the editor is not loaded, most possibly because its JS is not loaded. Do you see a 404 for that in the log there too? Please share the full browser log.

@pbull001
Copy link
Author

how do I grab the "full browser log" :)

@pbull001
Copy link
Author

looks like everything is be delivered:
image

@Piedone
Copy link
Member

Piedone commented Jan 16, 2025

Sorry, more precise is that please share a HAR file, which will include all data about the browser's network communication. See e.g. this guide: https://support.zendesk.com/hc/en-us/articles/4408828867098-Generating-a-HAR-file-for-troubleshooting

@pbull001
Copy link
Author

IssueRecording.zip

Zipped HAR file attached, I think :)

@Piedone
Copy link
Member

Piedone commented Jan 19, 2025

The problem is that OrchardCore.Markdown/Scripts/mde.mediatoolbar.js is not included, which, contrary to its name, also includes the EasyMDE Markdown editor itself too.

Do you perhaps have the Media feature turned off?

There seems to be an implicit dependency between the Markdown editor and the Media module.

@pbull001
Copy link
Author

Hooray - thank you!!!!!!! That's it - Media module needs to be enabled. Maybe make Markdown dependent on Media via manifest file in Markdown module?

@Piedone Piedone changed the title Markdown WYSIWG editor not rendering in Contents - Edit view. Fix the Markdown editor's implicit dependency on Media Jan 20, 2025
@Piedone
Copy link
Member

Piedone commented Jan 20, 2025

Great!

Yep, that's an issue. There are multiple problems:

  • While MarkdownBodyPart.Edit.cshtml renders the EasyMDE editor, it's not including the editor's script, only Media-MarkdownBodyPart.Modal.cshtml, in mde.mediatoolbar.js. The editor template should include the editor's script.
  • mde.mediatoolbar.js contains both the editor and its Media toolbar item. These should be split, both being included only in their respective templates.

Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

1 similar comment
Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@hishamco
Copy link
Member

@Piedone what's the action needed here?

@Piedone
Copy link
Member

Piedone commented Jan 30, 2025

See above.

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

4 participants