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

Don't set context to empty string by default #1726

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

amieiro
Copy link
Member

@amieiro amieiro commented Oct 18, 2023

Problem

This PR solves the bug introduced here, as this bug sets the context property to empty string if the value is NULL.

Fixes #1724.

Solution

The solution is to remove one check that sets the property context to empty string if its value is NULL, and to check if the context property is a string before using with the mb_strlen function as its paremeter, to avoid introducing the previous bug (warning) another time.

Testing Instructions

I have made 2 manual tests with the same steps:

  • Create a subproject.
  • Import the originals for this new subproject.
  • Create a translation set for this new subproject (a new locale).
  • Import the translations for this new subproject and translation set.
  1. Before this bugfix, after creating the originals, the originals without context are stored as empty strings in the database. When I import the translations for the subproject and the translation set, this import process fails to import most of the strings.
  2. With this bugfix, the imported originals without context are stored as NULL in the database. When I import the translations for the subproject and the translation set, this import process works fine.

@amieiro amieiro merged commit 7c700cc into GlotPress:develop Oct 18, 2023
6 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.

Don't set context to empty string by default
2 participants