Skip to content

Locales: avoid Fatal Errors when GlotPress is active.#4081

Merged
kraftbj merged 2 commits intomasterfrom
fix/fatal-glotpress
Jun 9, 2016
Merged

Locales: avoid Fatal Errors when GlotPress is active.#4081
kraftbj merged 2 commits intomasterfrom
fix/fatal-glotpress

Conversation

@jeherve
Copy link
Copy Markdown
Member

@jeherve jeherve commented Jun 7, 2016

@jeherve jeherve added Bug When a feature is broken and / or not performing as intended [Status] Needs Review This PR is ready for review. [Focus] i18n Internationalization / i18n, adaptation to different languages labels Jun 7, 2016
@jeherve jeherve added this to the 4.1 milestone Jun 7, 2016
@jeherve
Copy link
Copy Markdown
Member Author

jeherve commented Jun 7, 2016

cc @akirk

@zinigor
Copy link
Copy Markdown
Contributor

zinigor commented Jun 8, 2016

Seeing how locales.php is more consistently updated in GlotPress than on our side I think it's going to be OK this way.

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Jun 8, 2016
@akirk
Copy link
Copy Markdown
Member

akirk commented Jun 8, 2016

I agree to check if the class is defined, though I think it is safe to assume that if GP_Locale is defined then also GP_Locales is defined, so the patch can be reduced.

locales.php Outdated
@@ -1,4 +1,7 @@
<?php

if ( ! class_exists( 'GP_Locale' ) ) :
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be enough to only have:

if ( class_exists( 'GP_Locale' ) ) {
    return;
}

If GP_Locale is defined, GP_Locales is probably defined too.

@see #4081 (comment)
@jeherve
Copy link
Copy Markdown
Member Author

jeherve commented Jun 8, 2016

@akirk That makes sense. I've edited my Pr accordingly.

@jeherve jeherve modified the milestones: 4.0.4, 4.1 Jun 8, 2016
@akirk
Copy link
Copy Markdown
Member

akirk commented Jun 8, 2016

LGTM!

@kraftbj kraftbj merged commit 67394f4 into master Jun 9, 2016
@matticbot matticbot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Jun 9, 2016
@kraftbj kraftbj deleted the fix/fatal-glotpress branch June 9, 2016 17:06
kraftbj pushed a commit that referenced this pull request Jun 9, 2016
* Locales: avoid Fatal Errors when GlotPress is active.

Reported here:
https://wordpress.org/support/topic/fatal-error-with-glotpress-activated

* Locales: only check for GP_Locale before to load the 2 classes.

If GP_Locale is defined, GP_Locales is probably defined too.

@see #4081 (comment)
@kraftbj
Copy link
Copy Markdown
Contributor

kraftbj commented Jun 9, 2016

Cherry-picked via 5f80858 to branch-4.0

jeherve added a commit that referenced this pull request Jun 13, 2016
jeherve added a commit that referenced this pull request Jun 14, 2016
@georgestephanis
Copy link
Copy Markdown
Contributor

georgestephanis commented Apr 12, 2017

This is being reverted by #6965 as wpcom has resolved the issue differently:

r135921-wpcom

georgestephanis added a commit that referenced this pull request Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Focus] i18n Internationalization / i18n, adaptation to different languages Touches WP.com Files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants