extras-evolution / MaxiGallery

1 stars 5 forks source link

dragsort no pics when SVG icons in page template or chunk #4

Open leonie12 opened 6 years ago

leonie12 commented 6 years ago

Evo 1.4 PHP 7.0 MaxiGallery 0.6 In various installations, local and live, there are no more pictures shown in dragsort view, maybe since update to Evo 1.4RC or 1.4. In developer tools console I get this error: „TypeError: this.className.test is not a function“ Do not know if this is the reason for no pictures on the page.

Normal gallery view and normal gallery management page are o.k.

bossloper commented 6 years ago

Do you have QuickManager plugin enabled? If so try disabling that as a test.

leonie12 commented 6 years ago

QuickManager was enabled. Disabling it does not change anything. Issue persists. No images to sort.

bossloper commented 6 years ago

this.className.test ... that might suggest you have some other frontend plugin or code (maybe using jquery) that is conflicting with mootools. But hard to say. You really need to go back to a version that was working and step forward with upgraded gradually.

leonie12 commented 6 years ago

This website does not use any javascript in frontend. In 1.4.0 RC2 everything works.

bossloper commented 6 years ago

If you have maxigallery then you are running javascript in frontend. I think this.className.test is significant, but not part of maxigallery so there is some other javascript/jquery script running on the frontend.

leonie12 commented 6 years ago

Nothing that I actively installed. Only the Evolution-CMS scripts that belong to the installed snippets, plugins.

bossloper commented 6 years ago

Then I would try as a test disabling all plugins. After that I am out of ideas.

leonie12 commented 6 years ago

If I see this error in developper console it seems that moosortables.js is the cause of the problem:

`gallery.html?dragsort=1:34 Uncaught TypeError: this.className.test is not a function

at SVGSVGElement.hasClass (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:80:174)

at $Element (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:181:48)

at eval (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:257:232)

at Array.forEach (<anonymous>)

at Array.filterByClassName (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:257:210)

at HTMLDocument.eval (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:239:31)

at Array.forEach (<anonymous>)

at HTMLDocument.getElements (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:202:3)

at HTMLDocument.getElementsByClassName (eval at <anonymous> (/assets/snippets/maxigallery/js/mooSortables.js:2), <anonymous>:251:196)

at parseImages (/assets/snippets/maxigallery/js/draggableReorder.js:43)`
leonie12 commented 6 years ago

Even with all plugins disabled: No change. Issue persists.

leonie12 commented 6 years ago

In 1.4.0.RC2 where evrything works fine, there are exactly the same files (devtools network tab) loaded as in 1.4.1 where dragsort view is without images and therefor with above error message in dev console. The reason for the issue seems not related to the version of Evo but to the use of SVG icons (see below).

leonie12 commented 6 years ago

I found a strange way to trigger the issue: If I replace in working 1.4.0.RC2 <i class="icon"></i>right with <svg class="icon icon-right"><use xlink:href="assets/images/icons/symbol-defs.svg#icon-right"></use></svg> anywhere in template or any chunk without changing anything else this triggers reproducibly the issue.

In Evo 1.4.1 the behaviour is the same.

I tested some further and have found that adding SVG icon instead of icon font to maxigallery template is o.k. and works. But as soon as I replace an icon font icon in a chunk (that is not related to maxigallery) or page template to an SVG icon as above there are no more pics in dragsort view and the error appears in dev console.

Has anybody any idea what is going on here and how to solve the issue? SVG icons are a best practice today and should not trigger issues.

leonie12 commented 6 years ago

Would be nice to get to know if MG is still under development and if there is a chance that this issue gets solved or if it is advisable to change to another gallery snippet that does not have this issue. At the moment it seems that from the evo galleries only MG has the pageview mode or similar function.

bossloper commented 6 years ago

I do not think there is any development going on with MG. I do use it, but for the fact it has frontend buttons and the ability to store images on a per page basis. Plus do not use any of the built in 'types' (all custom made) and I have customised it to a point I would not want to share with the community. I might get to a point where I can merge what I have with the current version, but no promises! :-)

leonie12 commented 6 years ago

I think it would be very welcome if MaxiGallery would be further developed.

I tried changing to SimpleGallery but was not able to get it working the way MG does in my installs. Until now the overall function of MG is still there, but the issues with SVG icons on the page (seems to be caused bysome MG JS) and thereof no dragsort is a major problem for the usability of MG.