webadvanced / Orchard-SiteMap

SiteMap module for Orchard CMS
14 stars 21 forks source link

Unable to reposition routes on the Display page #8

Closed nickalbrecht closed 7 years ago

nickalbrecht commented 11 years ago

I'm running the AdvancesSitemap 1.4.0 module on Orchard 1.6 and I can't reposition any of the routes on the Display tab of the SiteMap's settings page. Upon checking for errors I found that javascript is encountering an error.

Uncaught TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'curCSS' jquery-ui-1.8.17.custom.min.js:9

Upon searching for a solution I came across this link in the jQuery bug tracker. http://bugs.jquery.com/ticket/11921

Looks like the method curCSS() is obsolete has been causing compatibility issues between a few different versions of jQueryUI. Can the AdvancedSitemap project be modified to use css() instead or something that hasn't been marked as obsolete?

CPyle commented 11 years ago

This is a matter of the jQuery UI version bundled with the module no longer being compatible with the version of jQuery being used. I ran into this myself a few days ago and fixed it by replacing the jQuery UI version the module uses with the newest version.

I'll be updating the project with that and a couple other fixes pretty soon, but in the meantime you can fix it locally by updating the jQuery UI version it is using.

cranca commented 10 years ago

Hi CPyle, I'm having the same issue running AdvancesSitemap 1.6.0 on Orchard 1.7.2.0... I did what you suggest and doesn't worked for me.

I replaced jquery-ui-1.10.0.custom.min.js with jquery-ui-1.10.4.custom.min.js in the Scripts folder and changed also the ScriptInclude at DisplaySettings.cshtml and restarted Orchard with no luck.

Perhaps I'm missing something? Thanks for your time!

cranca commented 10 years ago

I found it!

The problem was the script sorting in the rendered admin page, not the version of jQueryUI. Digging in the source I found this:

<script src="/Modules/Orchard.MediaLibrary/Scripts/modal-window.js" type="text/javascript"></script>
<script src="/Modules/WebAdvanced.Sitemap/scripts/jquery-ui-1.10.0.custom.min.js" type="text/javascript"></script>
<script src="/Modules/WebAdvanced.Sitemap/scripts/admin.displaysettings.js" type="text/javascript"></script>
<script src="/Modules/Orchard.jQuery/scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="/Core/Shapes/scripts/base.js" type="text/javascript"></script>
<script src="/Themes/TheAdmin/scripts/admin.js" type="text/javascript"></script>

jQueryUI is loading before jQuery so this is the problem. My workaround was to load jQuey in first place using .AtHead() in the admin layout.cshtml, that I know is not a good practice but it solve my issue by now.

Salut!