Skip to content

Conversation

@trymebytes
Copy link
Contributor

What?

This PR fixes the fatal error thrown below;

E_ERROR: Uncaught TypeError: Argument 2 passed to GP_Builtin_Translation_Warnings::warning_named_placeholders() must be of the type string, array given, called in /home/wporg/public_html/wp-content/plugins/glotpress/gp-includes/warnings.php on line 101 and defined in /home/wporg/public_html/wp-content/plugins/glotpress/gp-includes/warnings.php:671

Why?

It throws a fatal error.

How?

The error is caused when a JSON file with a double array e.g {"%s unread item":[["a ungelesen","b ungelesen"]]} is imported into a project

Testing Instructions

Screenshots or screencast

@trymebytes trymebytes marked this pull request as draft February 17, 2023 08:47
@trymebytes trymebytes force-pushed the fix-import-json-error branch from 65eccba to eabbe94 Compare February 20, 2023 12:45
@trymebytes trymebytes force-pushed the fix-import-json-error branch from 4b40642 to fdd03ac Compare February 21, 2023 11:48
@trymebytes trymebytes marked this pull request as ready for review February 21, 2023 17:40
@ocean90
Copy link
Member

ocean90 commented Feb 21, 2023

What's the source of the JSON file?

@akirk
Copy link
Member

akirk commented Feb 22, 2023

@ocean90 we don't know but we have been able to reproduce the fatal error with a JSON file like this: {"%s unread item":[["a ungelesen","b ungelesen"]]}

@trymebytes trymebytes requested review from akirk and ocean90 and removed request for akirk and ocean90 February 24, 2023 12:49
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.

Works for me as expected. No fatal error anymore.

@akirk akirk merged commit 9fe0dd1 into GlotPress:develop Feb 28, 2023
Copy link

@ikmalzaidi ikmalzaidi left a comment

Choose a reason for hiding this comment

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

Master

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.

4 participants