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

removes usage of deprecated jQuery.size() (#11874) #11883

Merged
merged 1 commit into from Jul 20, 2017
Merged

removes usage of deprecated jQuery.size() (#11874) #11883

merged 1 commit into from Jul 20, 2017

Conversation

mneudert
Copy link
Member

As discovered in #11874 the page overlay breaks when the overlayed page contains it's own version of jQuery. To be specific a version of the 3.x range.

Looking at the console log the culprit is https://api.jquery.com/size/ not being available on a selector result. It was dropped in 3.x after being deprecated since 1.8. And the jQuery from the opened site replaces the one packaged with Piwik.

This patch replaces all calls I could find with the suggested .length access. There are 2 additional calls in the AnonymousPiwikUsageMeasurement plugin I know of but those need a separate PR.

For good measurement I replaced all calls to size() with a boolean style .length access. If the more prevalent style should be a real integer check like .length > 0 I will happily adjust them.

@sgiehl sgiehl added the Needs Review PRs that need a code review label Jul 20, 2017
@sgiehl sgiehl added this to the 3.0.5 milestone Jul 20, 2017
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a rough look at the changes and did some local testing. As no tests are failing as well: :shipit:

@sgiehl sgiehl merged commit 9c7d7ff into matomo-org:3.x-dev Jul 20, 2017
@mneudert mneudert deleted the issue-11874 branch July 20, 2017 19:13
@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants