eea / eea.jquery

jQuery plugins for Plone
http://eea.github.com/docs/eea.jquery
3 stars 11 forks source link

jquery is breaking folder_contents view on Plone 5 #7

Closed Martronic-SA closed 7 years ago

Martronic-SA commented 8 years ago

There must be a conflict between jquery (required by eea.facetednavigation) and Plone 5. The foldercontents view doesn't show up and leaves an empty central column. Consol debug log: TypeError: $.tree.datastores[this.settings.data.type] is not a constructor http://**/**_/++plone++static/++unique++2016-09-30%2010%3A13%3A37.067811/faceted-navigation-jquery.min.js Line 15 and line 15 is the ++resource++jquery.jstree/jquery.tree.js

pbauer commented 7 years ago

eea.facetednavigation depends on eea.jquery which provides a jquery.tree.js package (originally from http://jstree.com). This package is in conflict with the jqtree module that mockup uses (Products/CMFPlone/static/components/jqtree/tree.jquery.js, which is http://mbraak.github.io/jqTree/ and is used for related items) as they both register against the global $.tree jquery plugin.

dals83 commented 7 years ago

I am having the exact same problem. Any solution to this yet?

tokewf commented 7 years ago

Using another name than $.tree in <plone dir>/eggs/eea.jquery-9.8-py2.7.egg/eea/jquery/plugins/jstree/jquery.tree.js solves the problem. Modifying the egg directly is incredibly hacky but works.

For version 9.8 of eea.jquery, occurrences of .tree on the following line numbers should be changed to something unique, for instance .jstree:

17 165 twice 171 183 307 372 616 782 938 1179 1180 1567 twice 1629 1637 twice 1638 twice 1819

Furthermore, eea.facetednavigation needs to be modified to reflect the new name. For version 10.3, the file <plone dir>/eggs/eea.facetednavigation-10.3-py2.7.egg/eea/facetednavigation/widgets/path/tree.js will have to be modified on line 75, where .tree should be replaced with .jstree.

Please note that .tree may occur elsewhere in both modified files, e.g. in references to jquery.tree.js or as CSS class names. These occurrences should not be modified.

Finally, to make the changes appear on the site, I had to go to the resource registry at http://yoursite/@@resourceregistry-controlpanel, click on faceted-jquery, remove jstree from the resources field, save, add jstree again and save.

alecghica commented 7 years ago

@tokewf a pull request is welcomed!

avoinea commented 7 years ago

Fixed and released: