-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Diff View in Template Manager is broken #25323
Comments
Issue and JS error confirmed. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25323. |
The js error happens only when editing a file from an override. When editing any other file not belonging to any override, the js errro doesn't happen. So it seems really to be related to the override management. |
No idea what that could be. I think it needs a js expert. Maybe @dgrammatiko can help? |
@richard67 No, that's not related. |
My guess it's to do with #24463. |
That could be. I will check details later after work. |
@brianteeman Could you have a look on this issue? I think it really can have something to do with the new switchers from PR #24463 , like Sharky supposes, because that diff view for override files in the template manager contains switchers, too, and those seem still be the old ones. |
Not able to test right now. the template_overrides table never gets updated I doubt very much it is anything to do with the switcher code as that is pure css. But you can test it yourself by deleting the class=switcher for two fields in administrator\components\com_templates\forms\source.xml |
@brianteeman Thanks, I've tried that, removing class from the 2 switchers, and as you supposed that did not help. It seems the js of that diff view is either broken or not loaded at all. Maybe something to do with the codemirror editors in that view? Do you know who can help here further? I first thought some selector in js may fail because of changed classes, that's why I thought it could be related to your changes. |
FWIW the js of that diff view was depending on 2 events emitted by the old switcher. Those events do NOT exist any more, therefore, the script doesn't do anything anymore... |
@dgrammatiko This explains a lot. Thanks for helping. |
@richard67 I can also describe a possible solution:
((Joomla) => {
Joomla.switchDifState = (event) {
if (event.target.checked) {
event.target.dispatchEvent(new CustomEvent('theNameOfTheExistingEventForOn'));
} else {
event.target.dispatchEvent(new CustomEvent('theNameOfTheExistingEventForOff'));
}
})(Joomla);
|
@dgrammatiko Thanks. I'll try to find some time on weekend. But if someone who is more familiar with js and events finds time before, I would not be unhappy. |
I'd propose #26359 as a fix. Please have a look there! |
Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/25323 |
please test #26359 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25323. |
Steps to reproduce the issue
Expected result
You see the diff-view
Actual result
No diff-view is opened.
Additional comments
See #21851 for more information about diff-view
The text was updated successfully, but these errors were encountered: