Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Bug found

Bug found 14 years 3 months ago #9183

  • jmagne
  • jmagne's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Hi,

I guess I found a bug and the associated workaround.
Here is the problem : when I set a custom field as radio button and the values contain latin characters, the record detail does not find the selected value and no option is selected (even though my custom field is mandatory so there is a value).

In the class.dtregister.php :: class Custom_field / Line 2070
the record value is loaded and later compared with the possible values array
$value = isset($obj->{$this->name})?$obj->{$this->name}:$this->selected;

Problem is the 2 values to be compared are not within the same encoding as the possible values array is UTF8 encoded on line 2088
$data=trim($dropDownDatas[$i]);
$data=htmlentities(stripslashes(trim($dropDownDatas[$i])),null,'UTF-8');

I suggest then to encode the selected value with the same method.
so I change
$value = isset($obj->{$this->name})?$obj->{$this->name}:$this->selected;
$arrValues=explode("|",$value);
by
$value = isset($obj->{$this->name})?$obj->{$this->name}:$this->selected;
$value = htmlentities(stripslashes(trim($value)),null,'UTF-8');
$arrValues=explode("|",$value);

Hope this helps
Jeremy

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.136 seconds