-
Notifications
You must be signed in to change notification settings - Fork 799
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
Fix Map Block Crash With >2 Points #14182
Fix Map Block Crash With >2 Points #14182
Conversation
…or. Wrap in try/catch to fix.
Caution: This PR has changes that must be merged to WordPress.com |
This is an automated check which relies on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well in my tests. Should be good to merge!
* Changelog: 8.1 additions * Changelog: add #13858 * Changelog: add #13963 * Changelog: add #14174 * Changelog: add #14178 * Changelog: add #14175 * Changelog: add #14192 * Changelog: add #14196 * Changelog: add #14182 * Changelog: add #14218 * Changelog: add #14214 * Changelog: add #13757 * Changelog: add #14190 * Changelog: add #14131 * Changelog: add #14101 * Changelog: add #14203 * Changelog: add #14211 * Changelog: add #14224 * Changelog: add #14230 * Changelog: add #14241 * Changelog: add #14249 * Changelog: add #14264 * Changelog: add #14263 * Changelog: add #14256 * Changelog: add #10189 * Changelog: add #14240 * Changelog: add #14239 Also added some new entries to the testing file. Co-authored-by: Igor Zinovyev <zinigor@gmail.com>
* Changelog: 8.1 additions * Changelog: add #13858 * Changelog: add #13963 * Changelog: add #14174 * Changelog: add #14178 * Changelog: add #14175 * Changelog: add #14192 * Changelog: add #14196 * Changelog: add #14182 * Changelog: add #14218 * Changelog: add #14214 * Changelog: add #13757 * Changelog: add #14190 * Changelog: add #14131 * Changelog: add #14101 * Changelog: add #14203 * Changelog: add #14211 * Changelog: add #14224 * Changelog: add #14230 * Changelog: add #14241 * Changelog: add #14249 * Changelog: add #14264 * Changelog: add #14263 * Changelog: add #14256 * Changelog: add #10189 * Changelog: add #14240 * Changelog: add #14239 Also added some new entries to the testing file. Co-authored-by: Igor Zinovyev <zinigor@gmail.com>
Changes proposed in this Pull Request:
As reported in #14177 the Map block crashes at the moment when a third point is added. If a map has only one point the Mapbox zoom control is shown. When a second point is added the map's scale is calculated based on the two positions and the zoom control is removed. The crash occurs when we call
removeControl()
on a control that has already been removed. This is why the issue occurs only when a third point is added to a map—it's removed when point 2 is added then removed again for point 3. It's difficult to say why this is popping up now—it could be related to a change in the Mapbox library, but tough to guess. This PR resolves the issue by wrappingremoveControl()
in a try/catch, suppressing the error. It does not appear that there are any side effects to the error so this should be a solid solution.Fixes #14177
Testing instructions:
master
create new Map.Proposed changelog entry for your changes: