Skip to content

Conversation

@amieiro
Copy link
Member

@amieiro amieiro commented Sep 26, 2023

Problem

Using PHP8.2, I get some deprecation warnings when I access to the different locales in a project, because it tries to create dynamic properties:

  • $name_with_locale
  • $rejected_count
  • $old_count
  • $percent_translated
  • $wp_locale

image

PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$name_with_locale is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/routes/project.php on line 36
PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$rejected_count is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/things/translation-set.php on line 638
PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$old_count is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/things/translation-set.php on line 638
PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$percent_translated is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/routes/project.php on line 42
PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$wp_locale is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/routes/project.php on line 44
PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$rejected_count is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/things/translation-set.php on line 638
PHP Deprecated:  Creation of dynamic property GP_Translation_Set::$old_count is deprecated in /wordpress/glotpress2/wp-content/plugins/GlotPress/gp-includes/things/translation-set.php on line 638

Solution

To avoid these warnings, I have added these properties to the GP_Translation_Set class.

@amieiro amieiro requested review from akirk and trymebytes September 26, 2023 17:23
Copy link
Member

@akirk akirk left a comment

Choose a reason for hiding this comment

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

Thank you!

@amieiro amieiro merged commit 7e3a698 into GlotPress:develop Sep 27, 2023
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