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

Solve some warnings with the glossary suffixes #1779

Merged
merged 8 commits into from Jan 26, 2024

Conversation

amieiro
Copy link
Member

@amieiro amieiro commented Jan 25, 2024

Problem

We are getting some warnings with the glossary suffixes:

PHP Warning:  Undefined array key "abbreviation" in wp-content/plugins/GlotPress/gp-templates/helper-functions.php on line 409
PHP Warning:  foreach() argument must be of type array|object, null given in wp-content/plugins/GlotPress/gp-templates/helper-functions.php on line 409

Solution

This PR:

  • removes all elements in the $suffixes array with empty values.
  • skip computing the $suffixes[ $type ] with empty values.

Testing Instructions

  • Translate some strings with the develop version and see some warnings in the debug.log file.
  • Checkout to the branch of this PR. Now you should not see the previous warnings.

@trymebytes trymebytes removed the request for review from akirk January 26, 2024 10:09
Copy link
Contributor

@trymebytes trymebytes left a comment

Choose a reason for hiding this comment

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

Tested, looks good to me!

@trymebytes trymebytes requested a review from akirk January 26, 2024 10:10
@amieiro amieiro merged commit 7606706 into GlotPress:develop Jan 26, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants