saltcorn icon indicating copy to clipboard operation
saltcorn copied to clipboard

Serious problems with JQuery

Open gianlucafiore opened this issue 1 year ago • 6 comments

image

I'm having serious problems with plugins that depend on JQuery, it's been happening to me for a few days that I have to constantly reinstall plugins like Selectize, Select2, Flatpickr etc... I reinstall them, restart the server, and everything works fine, the next day I have the errors in question again such as the console, which prevent me from opening the pop-ups or displaying the editing forms correctly

gianlucafiore avatar Jan 02 '25 14:01 gianlucafiore

image I am detecting that the jquery module is being imported 2 times with different versions, one from the root, and another from "Image-cropper", and until what I remember from a long time ago that I programmed years ago with JQuery and Razor of C#, this brought the same problem, since the variables in memory were broken apparently

gianlucafiore avatar Jan 02 '25 14:01 gianlucafiore

the problem here is that image cropper is including jquery in its headers, which is unnecessary - @anteolic if you could remove the first object in the headers export that would fix the problem. Jquery is already loaded on every saltcorn page

glutamate avatar Jan 14 '25 18:01 glutamate

I removed it and updated the version, but I don’t see the new updated version in the module store on the free Saltcorn hosting.

anteolic avatar Jan 15 '25 10:01 anteolic

Imho the problem is that jquery is even being used :)

It's best to abandon the old legacy, at least gradually... For example, to replace the selectize.js, there is this, Alternative for the menu editor, And so on...

Ingenu1ty avatar Jan 16 '25 21:01 Ingenu1ty

cropper module removed jquery in https://github.com/anteolic/simple-cropper/commit/46da7f1778cf10231c70afda1e2719d7704903ff released in 0.3.2

I too would love to see compulsory jquery dependency reduce over time (ideally to nil), but that would be best served in its own separate issue.

@glutamate This issue can be closed if simple-cropper 0.3.2+ is available in the saltcorn store

EDIT: Confirming 0.3.2 from saltcorn store is available

Image

koobs avatar Aug 05 '25 05:08 koobs

It's best to abandon the old legacy, at least gradually... For example, to replace the selectize.js, there is this, Alternative for the menu editor, And so on...

See #3502 at least to cover select related legacy/dependencies part of the broader equation

koobs avatar Aug 21 '25 02:08 koobs