mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.67k stars 496 forks source link

tags will not show up other than English #464

Closed ttkrpink closed 1 year ago

ttkrpink commented 2 years ago

Describe the issue If you add a category in Chinese or Arabic, it will be displayed fine. If you add a new tag in Chinese to the admin page, it will not be displayed. If you add a new tag in Arabic to the admin page, it will crash the server.

To Reproduce Steps to reproduce the issue:

  1. Go to the Django admin page
  2. Add a new tag. If it's in English, everything works fine. If it's in Chinese, it will not be displayed. As shown in the second screen capture, the first entry is not shown. If you input Arabic, it will crash the server error 500
  3. If you add a new tag in the Media Edit page, it will not be displayed.

Expected behavior It should be displayed as the category page displayed just fine.

Screenshots image image image

Environment (please complete the following information):

mgogoulos commented 1 year ago

I've created https://github.com/mediacms-io/mediacms/pull/801 and will merge it now that fixes this problem.

Until now tags were allowed to contain English characters and letters only, while now all characters are allowed (so you can create tags in Russian/Chinese etc). Special characters as #, ( etc are still stripped.

Also the 500 error on Django admin is happening because when you save the tag it gets stripped out of the blacklisted characters and what remains is an empty tag, that gets to be added twice. This cannot happen when you create a tag by Editing a media