Fix Map Block Crash With >2 Points#14182
Merged
jeffersonrabb merged 1 commit intomasterfrom Dec 11, 2019
Merged
Conversation
…or. Wrap in try/catch to fix.
Contributor
|
Caution: This PR has changes that must be merged to WordPress.com |
Collaborator
This is an automated check which relies on |
jeherve
approved these changes
Dec 11, 2019
Member
jeherve
left a comment
There was a problem hiding this comment.
This works well in my tests. Should be good to merge!
zinigor
added a commit
that referenced
this pull request
Dec 30, 2019
* 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>
zinigor
added a commit
that referenced
this pull request
Dec 30, 2019
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
mastercreate new Map.Proposed changelog entry for your changes: