Hi team,
This bug may be fixed by the soltuion in this post.
In the grid field the first rows of textfields are having incorrect encoding applied (my guess is double encoding but I could be wrong).
You can reproduce this by having a grid field with two rows of two text fields and enter something that needs to be encoded like.
1'2"3In all of the fields and then after submitting view the entry.
In case anyone wants to resolve this before the next dev preview you can comment out line 639 in system\codeigniter\system\helpers\form_helper.php.
Be fair warned though that I really do consider this a temporary hack and in no way a fix as it may have other adverse effects I am sure CI and EE clean the inputs thoroughly before databasing but still.
Thanks for your time guys.
Hi DigitalDoctors,
That’s actually a new bug, thanks for catching that! I think we’re unnecessarily form_prepping the data we send to fieldtypes when we call their display_field() method, that shouldn’t be happening, fieldtypes should handle that themselves. It’s basically just to escape quotes when using the data in a form attribute. This should fix your problem:
Open system/expressionengine/fieldtypes/grid/libraries/Grid_lib.php, search for this line:
$display_field = ee()->grid_parser->call('display_field', form_prep($row_data));Then just remove the call to form_prep() like so:
$display_field = ee()->grid_parser->call('display_field', $row_data);It should fix values you saved to the DB without saving their encoded selves to the DB thereafter. For example, if you saved 1’2”3 in a field but didn’t edit that entry again, it should be fine, but if you ended up saving a value with entities in it, it won’t fix those.
Thanks again! Kevin
Thanks Kevin,
I would tend to agree with you but I had came to this conclusion when looking for a fix and the result it has is.
The first row is encoded properly however every row after isn’t encoded properly so a text field value of 1’2”3 results in
<input type="text" value="1'2"3 />Results in
1'2Which of course cuts off after whatever the enclosing quotes are in this case the double quote.
Cheers
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.