goFrendiAsgard / No-CMS

No-CMS, A CodeIgniter Based CMS Framework
299 stars 199 forks source link

Grocery CRUD ADD form is not working #145

Open andymnc opened 8 years ago

andymnc commented 8 years ago

php 5.6.11 and MariaDB 10.0.22 $this->output->enable_profiler(TRUE); on my method in the controller. logged as super admin in no-cms. trying to show a single table (no foreign keys, no connections with other tables... everything very simple) with an autoincrement id.

Grocery is showing the table, all the records, paginating them. I can edit and delete correctly. (so sql UPDATE and DELETE are working). The problem is with the ADD functionality. It shows the form, i can put into some data, but then, if i click on save or on save and go back to the list, it does nothing. The profiler is not showing anything, i have no new record on mariaDB anywhere.

on Config,php i have $config['global_xss_filtering'] = FALSE; $config['csrf_protection'] = FALSE; $config['compress_output'] = FALSE;

If I use $crud->unset_jquery(); in controller, then watching with Developer Tools in Chrome, I can clearly see this when i press SAVE:

Uncaught SyntaxError: Unexpected token a $.ajaxSubmit.success @ flexigrid-add.js:45 options.success @ jquery.form.js:150 cb @ jquery.form.js:407

If I do not use $crud->unset_jquery(); then I see a loading image instead of the ADD FORM, and the developer tools say: Uncaught TypeError: $(...).numeric is not a function(anonymous function) @ jquery.numeric.config.js:2 j @ jquery-1.11.1.min.js:2 k.fireWith @ jquery-1.11.1.min.js:2 m.extend.ready @ jquery-1.11.1.min.js:2 J @ jquery-1.11.1.min.js:2

And it stays loading forever...

goFrendiAsgard commented 8 years ago

Do you have many to many relationship in your fields? The problem is probably related to this issue: http://stackoverflow.com/questions/31419495/codeigniter-3-0-0-where-not-in-produces-not-for-one-column-only-in-query

You can download the latest version from github to resolve this issue.

Please let me know if the issue is still persists

andymnc commented 8 years ago

It's a simple table with 8k+ records, 54 columns, but no relations with other tables at all. So I don't think it's related with that. The temporary fix for me was to change the flexigrid-add.js in /assets/grocery_crud/themes/no-flexigrid/js at line 45. In my case after the first check at 35, the reassignment of data at 45 was always empty. Anyway, i try now the new version that you suggest and i let you know