valu-digital / wp-graphql-polylang

WPGraphQL Polylang Extension for WordPress
https://packagist.org/packages/valu/wp-graphql-polylang
GNU General Public License v2.0
129 stars 22 forks source link

When using language codes/slugs like 'nl-nl' the graphql return an enum error #80

Open mauritsweebers opened 2 years ago

mauritsweebers commented 2 years ago

Some websites need a double language code/slug. nl-nl nl-en be-nl be-fr be-en

The graphql does not open when a language is configured this way. it gives this php error en remains loading endlesly

Names must only contain [_a-zA-Z0-9] but "NL-NL" does not.

easy replicable by simply changing the code name of a language

It looks like a minor validation issue, but i can't trace it in the php

mauritsweebers commented 2 years ago

Seems this resolves the issue

$language_codes[strreplace('-', '', strtoupper($lang))] = $lang; but it hasn't been implemented

https://github.com/philJohnson/wp-graphql-polylang/blob/hotfix/LanguageCodes/src/PolylangTypes.php

emanuelstrom commented 6 months ago

This issue is still there. Maybe implementing the hotfix would be an idea? 😊