mdjnelson / moodle-mod_customcert

Enables the creation of dynamically generated certificates with complete customisation via the web browser.
https://moodle.org/plugins/mod_customcert
GNU General Public License v3.0
90 stars 158 forks source link

Repositon element - Edit element modal not working correctly #483

Closed marcboar closed 3 months ago

marcboar commented 2 years ago

Issue from https://moodle.org/plugins/mod_customcert

I'm opening this error following Julia's comments: 1.-When trying to modify an element from the 'Reposition elements' (rearrange) page, we encountered a bug. When trying to make any modification to an item from this page, the element is deleted, duplicated or left as it is, but it is never modified.

2.-Thanks for your answer. Sure enough, I've been digging around and it does seem like it's related to the double click. If you double click on an element, 2 editing windows open. In the first window we can see that the color is not loaded correctly with the javascript, and in the second window it is. We have seen that, from then on, sometimes just giving a click breaks the range of colors and whenever it fails to load the colors, it does not execute what you are going to change. Apart from this, what worries me is that generating this error, there is a moment where the field types are also crossed in the database. And a field that was "date" becomes "text". This breaks all the diplomas and long hours of work. Has anyone else experienced data crossing?

At the end, we think that the problem is caused by: -Double click that opens 2 windows (modal) with the same content, but the good one is the one in the back. So, doble click needs to be fixed to avoid the opening of multiple edit modals -The close button has a different action than Cancel button and when we close the Edit element by “X” button then the next modal (Edit element) that we open doesn’t show the colour picker and the content that we modify isn’t saved.

Thanks in advance for your help

mdjnelson commented 5 months ago

Thanks for the report. I have known about the colour picker disappearing for some time but did not know about the loss of data which is much more of a concern. Ill see if I can get to this soon.

mdjnelson commented 3 months ago

I ran into this just now. Going to work on a fix tomorrow.