Skip to content

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
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