Skip to content
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

JS error - wp is not defined #708

Open
benitolopez opened this issue Nov 8, 2017 · 3 comments
Open

JS error - wp is not defined #708

benitolopez opened this issue Nov 8, 2017 · 3 comments

Comments

@benitolopez
Copy link

Hi,

Every time I update a plugin through TGMPA I receive a JS error at the end of the process:

Uncaught TypeError: Cannot read property 'decrementCount' of undefined

The code fails in this script:

<script type="text/javascript">
	(function( wp ) {
		if ( wp && wp.updates.decrementCount ) {
			wp.updates.decrementCount( "plugin" );
		}
	})( window.wp );
</script>

Any idea?

@jrfnl
Copy link
Contributor

jrfnl commented Nov 8, 2017

Thanks for reporting this. TGMPA does not have its own javascript, but uses some of the scripts from WordPress Core. Seems they have been making some changes over the last few versions causing notices without impeding functionality. This needs to be investigated, especially how to get this working notice free across all supported WP versions.

@benitolopez
Copy link
Author

Yes, the "problem" it's inside the decrement_update_count() method which is called in the after() method of the Plugin_Upgrader_Skin class.

@jrfnl
Copy link
Contributor

jrfnl commented Nov 8, 2017

Side-note: this may be loosely related to #660 which also reports a notice coming from the WP core JS files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants