I'm continuing to develop a catalogue module on FUEL CMS, and I found some strange behaviour:
- when I set a textarea field like this:
$fields['descrizione'] = array('type' => 'wysiwyg', 'editor' => 'wysiwyg');
and I insert some content with accented letters (I'm italian) like à, è, ì, ò, ù these letters are being truncated from text on saving
- if I set a field with type "text", this is being rendered like a textarea. Only if I don't set the "type" property, the default value is applied and correctly a simple text field is shown
- if I change the "decimal" and the "separator" properties of a currency field, when the form goes in edit mode the value is not being represented correctly. Supposing I write this:
$fields['price'] = array('type' => 'currency', 'currency' => '€', 'separator' => '.', 'decimal' => ',');
and I insert the value € 305,00 and save, on edit I have € 30,500.00 (I have set the field in MySql both like 'float' and like generic 'text' and the value stored is "30500")
That's all for now. I'm trying to fix these on my own but obviously I thinked to report it on the forum
Comments
https://bugs.php.net/bug.php?id=48147
https://github.com/EllisLab/CodeIgniter/issues/261
I've found that if I changed my version of MAMP to use use 5.2 instead of 5.3, it would work. Had something to do with the iconv library.
With regards to the second issue, thanks for the report. I'll have a fix posted later today.
I've solved the special chars issue modifying the Utf8.php file in \fuel\codeigniter\core as written in the second link you included, changing the line
$str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
in
$str = !mb_detect_encoding($str, 'UTF-8', TRUE) ? utf8_encode($str) : $str; $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
About the currency issue, I've seen the commits you've done on GitHub, but it seems to not work well. If the field on MySql is declared like "text" and I insert on the form a value like "3.420,50" this is stored like "3.42.50". Otherwise, if I declare the field like "float", FUEL reports me an error on saving, saying "Value needs to be a number for 'price'." (I've set "." like separator and "," for decimals)
Have you had a look at the "text" type issue?
Thank you for your patience
I've just pushed an update for this to work with float values which is the intended field type. A text field type will still have the same result unfortunately.