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

Glossary Entry import doesn't validate part_of_speech #1200

Closed
dd32 opened this issue Sep 30, 2020 · 2 comments · Fixed by #1277
Closed

Glossary Entry import doesn't validate part_of_speech #1200

dd32 opened this issue Sep 30, 2020 · 2 comments · Fixed by #1277
Labels
good first issue [Type] Bug An existing feature is broken.
Milestone

Comments

@dd32
Copy link
Contributor

dd32 commented Sep 30, 2020

It seems like the Glossary Import doesn't validate the value of the part_of_speech field, which can be problematic for two reasons:

  • It doesn't display the "custom" value on the glossary page
  • It causes PHP Notices in gp-templates/glossary-entry-row.php

For example, see the month entry on https://translate.wordpress.org/locale/fa/default/glossary/

I see two options here

  • Reject entries which don't match a known value
  • Display the value as-is

It looks like the mismatched values on WordPress.org can be translated, typos, and combinations (ie. adj, subst). Abbreviation was common enough that I've created #1199 for that.

@dd32 dd32 added the [Type] Bug An existing feature is broken. label Sep 30, 2020
@dd32
Copy link
Contributor Author

dd32 commented Sep 30, 2020

Example notice:

PHP Notice: Undefined index: abbreviation   wp-content/plugins/glotpress/gp-templates/glossary-entry-row.php:4

@ocean90
Copy link
Member

ocean90 commented Oct 2, 2020

Yeah, we should reject any unknown value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue [Type] Bug An existing feature is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants