#33637 closed defect (bug) (fixed)
Plugin updater ajax loader gif never get updated to show the success message.
Reported by: | svovaf | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.2.2 |
Component: | Plugins | Keywords: | needs-patch shiny-updates |
Focuses: | ui, javascript, administration | Cc: |
Description
I'm a plugin developer and in my test environment I have multiple versions of my own plugin. They all located in different folders based on version number e.g. rating-widget.v.2.5.6.
The reason I have this setup is because I test upgrades from one version to another. So my use-case isn't esoteric.
When I click on the "update now" in /wp-admin/plugins.php I noticed that the ajax loader gif keep spinning forever. Even though the plugin's code is actually updated successfully.
I've done some debugging on the JS code and found an issue with:
b.updates.updateSuccess
The JS selector of the visual record of the updated plugin is based on slug:
(g = a('[data-slug="' + d.slug + '"]').first()
Without checking if the plugin is active or not. It could be easily fixed by changing the selector to:
(g = a('[data-slug="' + d.slug + '"].active').first()
I would submit the patch myself, but I never contributed to core so I'm not sure how to do it.
Change History (9)
#1
@
9 years ago
- Keywords needs-patch added
- Owner set to adamsilverstein
- Status changed from new to assigned
#2
follow-up:
↓ 4
@
9 years ago
- Yes, I only have one version of the plugin active at the time and I was trying to update the active version.
- I didn't try to update inactive plugins.
- I agree, updating the UI based on the clicked element would be the best. Since the JS looks uglified, it's kind of hard to work with it.
I'm happy to work up a patch, should I apply it on WP trunk? What's the SVN repo URL? Does everyone have permissions to patch it?
#3
@
9 years ago
Howdy svovaf, and welcome.
You can download the develop repository from https://develop.svn.wordpress.org/trunk/ (or if you prefer git, git://develop.git.wordpress.org/ ). This repository includes the core unit tests and build scripts and by default uses the unminified and unconcatenated javascript. Everyone has read privileges to these repos.
Once you have made the changes you wish to make, you can generate a patch file using the approriate git diff > 33637.patch
or svn diff > 33637.patch
. Then you can upload the patch here. Uploads don't trigger notifications, so please add the "has patch" workflow keyword and leave a comment after you have uploaded the patch.
#4
in reply to:
↑ 2
@
9 years ago
Replying to svovaf:
- Yes, I only have one version of the plugin active at the time and I was trying to update the active version.
- I didn't try to update inactive plugins.
- I agree, updating the UI based on the clicked element would be the best. Since the JS looks uglified, it's kind of hard to work with it.
I'm happy to work up a patch, should I apply it on WP trunk? What's the SVN repo URL? Does everyone have permissions to patch it?
In regard to the minified JS, you can add the following line to your wp-config.php file to use the source (unminified) JS:
define('SCRIPT_DEBUG', true);
Thanks for working on a patch!
#5
@
9 years ago
@svovaf Have you had a chance to work on a patch? If you have any questions, feel free to ping one of us on Slack.
Thanks!
Hello @svovaf, thanks for your bug report. Your diagnosis of the issue is very helpful.
Submitting your first patch can be daunting (but worth it!), there is a bit to get set up on your end. This is a good place to start reading: https://make.wordpress.org/core/handbook/tutorials/working-with-patches/
I understand the issue you are seeing and have some questions. It does seem like an edge case to have several plugins with the same slug installed, still it should be doable to get this working.
Do you only have one version of the plugin active, and you are updating this version? Couldn't you be updating an inactive version of the plugin? Then your code wouldn't work if I understand what you are proposing (thats the .active selector, right)? I think an ideal solution would have the callback update the plugin you clicked update on, without regard to the slug (which is essentially the underlying issue you are raising here).
I can try to work up a patch for your issue or help you work one up if you want to give it a shot!