Welcome Guest, Not a member yet? Register   Sign In
Editing unique data post input.
#2

Hi,

1. First you should remove below line from your edit method against slug field.

|is_unique[pages.slug]

2. Once validation is passed, do below steps.

2.1 Fire a simple db query to check if posted slug is equal to the existing db row slug (DB row should be fetched via DB ID which has been posted via hidden form field). If yes than update the db row straight forward.
2.2 If it is different then check if posted slug has not been used by any other DB entry (Simple select with slug as a where clause). If there is no row returned by query then update the DB entry with newly provided slug else inform user that provided slug is already used.

Thanks & Regards
Tapan Thapa
Reply


Messages In This Thread
Editing unique data post input. - by miiikkeyyyy - 03-02-2015, 06:33 PM
RE: Editing unique data post input. - by tapan.thapa - 03-02-2015, 10:39 PM
RE: Editing unique data post input. - by obiron - 03-03-2015, 01:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB