⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Validation gives "An error has occurred on saving"



Swede

Swede
  • profile picture
  • Member

Posted 05 July 2012 - 10:00 AM

Hi,

I can't get any form of validation to work in my installaion of grocery CRUD.
required_fields, set_rules...

When adding/updating a record in the database it gives the error "An error has occurred on saving".

I have even tested to add just one line to the examples that was included in the package, with the same result.

Any idea what the problem could be? Any work-around?


function customers_management()
{
$crud = new grocery_CRUD();
$crud->set_table('customers');
$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
$crud->display_as('salesRepEmployeeNumber','from Employeer')
->display_as('customerName','Name')
->display_as('contactLastName','Last Name');
$crud->set_subject('Customer');
[u][i][b]$crud->required_fields('contactLastName');[/b][/i][/u]
$crud->set_relation('salesRepEmployeeNumber','employees','{lastName} {firstName}');

$output = $crud->render();

$this->_example_output($output);
}

Swede

Swede
  • profile picture
  • Member

Posted 05 July 2012 - 10:22 AM

Info from Firebug:

500 Internal Server Error

Swede

Swede
  • profile picture
  • Member

Posted 05 July 2012 - 10:43 AM

Sorry...

I found the reason when I was taken a closer look into Firebug-results.
The language files was not set up properly by me.

Now it works fine.

mano.mykingdom

mano.mykingdom
  • profile picture
  • Member

Posted 26 May 2014 - 17:50 PM

I'm getting same kind of issue. May I know how you solved it? I'm using the same code as you did. What was wrong in that code?