-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
contentpreview-edit.js doesn't declare jQuery as its dependency #15181
Comments
Please provide repro steps so we can check it being broken and indeed fixed after adding a dependency. |
@Piedone I can only provide reprosteps for our OSOCE repository. Also there are pages where it's working: Where it's not working all those pages have |
Please provide an export of the content type you're using. Something is different than the built-in Blog Post, since if you check that with the latest source, this doesn't happen. |
And first make sure that this also happens with the OC source, i.e. it's not caused by anything in the custom solution. |
This is probably an issue after upgrading the admin theme. Can you submit a PR to adding to this? Line 17 in f843b91
We should spend time to remove jQuery from these older scripts. |
@MikeAlhayek Seems like I don't have the permission to commit. I thought I was added as a contributor. TL:DR I can't open a PR. |
You need to work in a fork. |
I will add this in our fork. |
yes create a branch out of your fork. then create a cross repository into OC main branch. Feel free to ping me when you create the PR. |
@MikeAlhayek here is the PR in our Fork |
Describe the bug
After upgrading to Orchard Core 1.8 some preview buttons inside of content item editors become broken.
They are broken because the driving script behind it called
contentpreview-edit
has an exception of:$ is not defined
is almost always due to a script being called beforejQuery
is registered.Same happens in Orchard Core as the problematic content items have
contentpreview-edit
script registered prior tojquery.js
Making a code that brings
jquery
in front resolved the problem.contentpreview-edit
doesn't declarejquery
as it's dependency:Nor in its corresponding ResourceManagementOptionsConfiguration
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.ContentPreview/ResourceManagementOptionsConfiguration.cs#L14-L17
Nor in the script inclusion in the Razor.
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/ContentPreview.Button.cshtml#L22
I can't write a direct way of reproducing this because when I am creating a Content Type from the Admin page it works but Content Types that are coming from Migrations and custom code are broken.
Either way
contentpreview-edit
should havejquery
declared as its dependency.The text was updated successfully, but these errors were encountered: