Welcome Guest, Not a member yet? Register   Sign In
is_unique issue on update
#18

Just a small remark (for myself and others).

I was using the model update() method in combination with post data coming from a HTML form:

PHP Code:
$postData¬† ¬† ¬† $this->request->getPost();
$model->update($id$postData); 
This "is_unique" validation rule only works if the id (primary key) is set. Despite I'm explicitly providing the id already to the model update() method.

TLDR: be sure that the data contains the id key even when using the model update() method. Example:

PHP Code:
$postData['id'] = $theId
Reply


Messages In This Thread
is_unique issue on update - by eleumas - 03-25-2021, 11:12 AM
RE: is_unique issue on update - by InsiteFX - 03-25-2021, 08:43 PM
RE: is_unique issue on update - by llyimo1920 - 04-20-2021, 10:47 PM
RE: is_unique issue on update - by Ahyaislive - 11-12-2021, 12:02 AM
RE: is_unique issue on update - by eleumas - 03-26-2021, 07:15 AM
RE: is_unique issue on update - by charleyskira - 12-16-2021, 08:30 AM
RE: is_unique issue on update - by kenjis - 12-16-2021, 09:48 PM
RE: is_unique issue on update - by BilltheCat - 01-20-2022, 03:00 AM
RE: is_unique issue on update - by Mano - 04-01-2022, 08:56 AM
RE: is_unique issue on update - by InsiteFX - 04-09-2022, 12:43 AM
RE: is_unique issue on update - by kenjis - 04-09-2022, 01:01 AM
RE: is_unique issue on update - by Mano - 04-10-2022, 03:04 AM
RE: is_unique issue on update - by ingrenee - 05-30-2022, 10:19 AM
RE: is_unique issue on update - by danger89 - 10-07-2022, 02:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB