Skip to content

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.

@amieiro amieiro requested review from akirk and trymebytes January 26, 2024 09:23
@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
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.

2 participants