User tests: Successful: Unsuccessful:
Pull Request for Issue #33063.
The com_media edit should use the whenDefined
instead of DOMContentLoaded to solve some race conditions
Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/whenDefined
Go to Media Manager in Joomla 4 admin
Click to Edit the joomla_black.png file
When on the CROP tab, just keep pressing save, save save save until the 4 fields show NaN
Takes 3-6 clicks.
NaNs all over the form
Real numbers only
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
I have seen it on page load (before this PR) but at other times too.
Ok, what should be the right testing procedure. (I think I could replicate it on fast reloads or saves)
Labels |
Added:
NPM Resource Changed
?
|
I may be doing it wrong (again). I applied the patch, ran npm ci (even jinstall) and I still get NaN after some clicks. Also, if NaN is actually saved into joomla_black.png it kills the Media manager (blue line goes slowly across the top but nothing happens - no folders or images to choose from). I had to delete that image (only 3 bytes) and copy in one from another install to restore functionality.
How did you actually apply the patch? Git or patch tester? I think patch tester is not safe for the build folder (but I maybe wrong I never used it)
@PhilETaylor can I have a test here? Thanks
Sorry first time seeing this PR (for a while).
rm -rf administrator/templates/atum/css; rm -rf templates/cassiopeia/css; rm -rf administrator/templates/system/css; rm -rf templates/system/css; rm -rf media/; rm -rf node_modules/; rm -rf libraries/vendor/;rm -f administrator/cache/autoload_psr4.php;rm -rf installation/template/css; composer install; npm ci
and then edited an image and on first page load I get a JS error
Tabs also are not preserving state on page reload (unrelated to this PR probably, but when refreshing the page, the first tab is always selected and not the last clicked tab)
Also, if NaN is actually saved into joomla_black.png it kills the Media manager (blue line goes slowly across the top but nothing happens
I tried to fix that and was shot down by the maintainers. #33141 So this is still a problem that will come back to haunt Joomla 4 admins if they have any display errors enabled.
Also probably unrelated to this pr. When you click SAVE you get no feedback (the ajax call is ok, but there is no feedback so you dont know if it did anything or not.
@PhilETaylor @ceford it should be ok now, it seems that I can't type a word without a typo (the attribute is nomodule
not nomodules
)...
Also probably unrelated to this pr. When you click SAVE you get no feedback (the ajax call is ok, but there is no feedback so you dont know if it did anything or not.
There is PR that really implemented all those todos I left as a placeholder, someone should merge that one: #30511
Category | JavaScript Repository NPM Change | ⇒ | Administration com_media Repository NPM Change JavaScript |
I just dropped the SPA approach here and added a few more fuses, so hopefully this is ok now
Sorry - no :-(
Ehm how did you manage to click so fast on the save? The button gets disabled when pressed and enabled at the finish of the process...
CMD+R (browser refresh)
In fact the very first page load of the edit page after applying your latest changes loaded the page with NaN :-(
I have tested this item
After 6 quick clicks the four fields are empty and I get this:
Notice: exif_imagetype(): Error reading from /Users/ceford/Sites/j4test/images/joomla_black.png! in /Users/ceford/Sites/j4test/libraries/src/Helper/MediaHelper.php on line 74
Notice: getimagesize(): Error reading from /Users/ceford/Sites/j4test/images/joomla_black.png! in /Users/ceford/Sites/j4test/libraries/src/Image/Image.php on line 185
The joomla-black.png file is only 3 bytes and neither Reset nor Close work. Going back to the Media menu gives me a dead Media screen until I replace that bad file with a good copy.
Still needs some work!
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-07-23 17:21:10 |
Closed_By | ⇒ | dgrammatiko |
I have seen it on page load (before this PR) but at other times too.