Child pages
  • Add mode to update only changed fields (when temporary tables not used)
Skip to end of metadata
Go to start of metadata

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/ae908ae56bbdb02a#

Currently when a few fields are changed the form, we update all of them. We
are doing so, since MySQL will figure out that himself and won't break
anything down.

But when:

   - user validates his email
   - admin approves that user

in the same time, then user can overwrite it's approved status OR admin can
overwrite user email validation status.

To solve this problem I propose to add special parameter to kDBItem::Update
method OR just do this always, when temporary tables are not used, that
will:

   - call kDBItem::GetChangedFields() to get list of changed fields
   - only include that fields in UPDATE sql statement and not all database
   fields

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

3 Comments

  1. Hi Alex,

    I see your point and you must be right. I personally have NO problem with
    doing things in kDBItem::Update method, but we need check and check again
    that kDBItem::GetChangedFields() properly saves all the changes and Update
    works as expected.

    DA

  2. That is what you'll be doing after I attach the patch :)
    On Jan 29, 2011 11:45 PM, "Dmitry A." <dandre...@gmail.com> wrote: