Truncated informations on create or edit a LONGTEXT field
- Single Page
Posted 01 February 2013 - 09:41 AM
Thank you for grocery crud. This is absolutely awesome. I have to admit that it saved me a lot of time and makes everything cleanest.
I have one row and I have one SQL request to put in it as a text. In order to do this, I have unsetted the texteditor since I only need to copy paste the SQL request into the field. Everything was fine but one particularly request is truncated after validation. So I assume maybe more could be alterated.
[img]http://www.image-heberg.fr/files/135972452402886.png[/img]
When you validate, return to the list, then modify again, the request appear truncated like this :
[img]http://www.image-heberg.fr/files/135972452403026.png[/img]
You could notice the blank espace before "LEFT JOIN" and "b.c" instead of "b.contrat=c.id"...
This is really weird, I don't know why this appends. Could you help me with this ?
If you need any other explanations, please ask me.
Thank you very much and sorry for my bad english
Posted 01 February 2013 - 11:33 AM
Posted 05 February 2013 - 09:08 AM
Anyone to help me ? :D
Posted 05 February 2013 - 09:38 AM
It seems really strange to be honest!
What happens if you don't validate for this field? Does it store ok?
Posted 05 February 2013 - 10:30 AM
So if I don't validate, my index function looks like this
public function index() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif (!$this->ion_auth->is_admin()) { //redirect them to the home page because they must be an administrator to view this redirect('auth/login', 'refresh'); } else { $crud = new grocery_CRUD(); /* $crud->set_theme('datatables'); */ $crud->set_subject('crons'); $crud->set_table('crons'); $crud ->unset_jquery() ->unset_export() ->unset_delete() ->unset_print() ->unset_texteditor('req_pgsql','full_text') ->columns('name', 'req_pgsql', 'active', 'desc') ->fields('name', 'req_pgsql', 'active', 'desc') ->add_fields('name', 'req_pgsql', 'active', 'desc') ->edit_fields('req_pgsql', 'active', 'desc') ->change_field_type('req_pgsql', 'text') ->display_as('name', 'Nom') ->display_as('active', 'Actif') ->display_as('desc', 'Description') ->display_as('req_pgsql', 'Requête') ->set_rules('name', 'Nom', 'trim|required') ->set_rules('active', 'Actif', 'trim|required') ->set_rules('desc', 'Description', 'trim|required'); /* ->set_rules('req_pgsql', 'Requête', 'required'); */ $crud->add_action('Activer/Désactiver', '', 'admin/crons/activation','icon-ok activate'); // Generate the crud $output = $crud->render(); // Build the template with the view $this->_crud_crons_output($output); } }
The problem is solved ! This is definitively strange.. Since I don't need any further verifications, I will keep it as it for now... But that would have been nice to now what is going on there .. But seems to not be related with grocery crud ...
Thank you very much, that was it.
problem solved
Posted 07 February 2013 - 05:25 AM
I was just checking the source of the library... and I have this weird idea...
can you move these two lines
->unset_texteditor('req_pgsql','full_text')
->columns('name', 'req_pgsql', 'active', 'desc')
AFTER this
->unset_texteditor('req_pgsql','full_text')
so your code changes like this,
$crud ->unset_jquery() ->unset_export() ->unset_delete() ->unset_print() ->fields('name', 'req_pgsql', 'active', 'desc') ->add_fields('name', 'req_pgsql', 'active', 'desc') ->edit_fields('req_pgsql', 'active', 'desc') ->change_field_type('req_pgsql', 'text') ->unset_texteditor('req_pgsql','full_text') ->columns('name', 'req_pgsql', 'active', 'desc') ->display_as('name', 'Nom') ->display_as('active', 'Actif') ->display_as('desc', 'Description') ->display_as('req_pgsql', 'Requête') ->set_rules('name', 'Nom', 'trim|required') ->set_rules('active', 'Actif', 'trim|required') ->set_rules('desc', 'Description', 'trim|required') ->set_rules('req_pgsql', 'Requête', 'required');
and let us know if this resolves the problem?
Posted 12 February 2013 - 09:59 AM
Hey,
I tried your solution, but since I have removed the trim like this
->set_rules('req_pgsql', 'Requête', 'required');
instead of this
->set_rules('req_pgsql', 'Requête', 'trim|required');
The problem seems to be gone :)
I really love grocery crud !
Thanks to everyone, problem solved