Project

General

Profile

Actions

Defect #6568

closed

Custom field min_length and max_length checks and multibyte strings

Added by Vitaliy Ischenko over 13 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
-
Start date:
2010-10-04
Due date:
% Done:

0%

Estimated time:
Resolution:
Wont fix
Affected version:

Description

If custom field contains multibyte string as a value, CustomValue.validate method will fail if byte length of string is out of range [min_length, max_length].

I've tried to use ActiveSupport::Multibyte::Chars and it fixed my case, but i don't know whether it is a right solution.


Related issues

Has duplicate Redmine - Defect #7490: issue's custom field string length checkClosed2011-01-29

Actions
Actions #1

Updated by Felix Schäfer over 13 years ago

Could you please give steps to reproduce this problem, i.e. what custom field did you create with what options, and what did you try to put in this custom field?

Actions #2

Updated by Vitaliy Ischenko over 13 years ago

I've created ProjectCustomField

For example:
  1. Name: Test
  2. Format: text
  3. Min length: 5
  4. Max length: 7

no default value, no regex
checkboxes left untouched

Then i've navigated to project settings and entered value 'АБВГДЕЖ'

After submitting - validation error appears: "Test is too long (maximum is 7 characters)"

Actions #4

Updated by Felix Schäfer over 13 years ago

I can confirm this problem, but I think as rails3/ruby1.9 is "around the corner", there's no big motivation for the core redmine to get adapted, though what you propose seems to be the preferred way to solve that. If you want to contribute those fixes back, make sure the existing tests pass and create some new to test the multibyte characters.

Actions #5

Updated by Go MAEDA over 9 years ago

Current Redmine can handle multibyte strings right. This issue can be closed.

Actions #6

Updated by Toshi MARUYAMA over 9 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

It depends on Ruby 1.8 or not.
Ruby 1.8 support is dropped on Rails4.

Actions

Also available in: Atom PDF