Date index for Mar 2003
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [achievo] Bug in NF_TRACK_CHANGES? [was: Re: [achievo] PostAdd -> PostEdit for project class]
At 17.34 13/03/2003 +0100, you wrote:
Problem solved, but first, let me explain why this is a bug, IMHO:
if you're going to compare, for instance, an "old project" with the new
one, you'd like to check if its sub-elements are changed too, now $record
doesn't contain any information related to the sub-elements of the node
(project, in this case) since they're not stored in the database table of
this node. hence, it's impossibile to check if sub-elements are changed or not.
I've solved this calling postUpdate with a different argument, modifying
atk/class.atknode (function updateDb):
//Now we call a postUpdate...
// OLD: $this->postUpdate($record)
// NEW:
$temprecord = $this->selectDb($pk);
$newrecordset = $temprecord[0];
$newrecordset["atkorgrec"] = $recordset[0];
$this->postUpdate($newrecordset);
Even if we must do some new db queries...
I think this could be ported to official atk version since it doesn't
modify the "interface" of this class and the behaviour of ...isChanged (for
instance for ToDos)
Your opinion: is this the right way to accomplish this task?
Kind regards,
Pietro
At 16.58 13/03/2003 +0100, you wrote:
At 13.16 13/03/2003 +0100, you wrote:
Since the project node is NF_EDITAFTERADD, you can ignore postAdd() and
just use postUpdate() and postDel(). You might want to add
NF_TRACKCHANGES so you in postUpdate() get the orginialrecord and easily
could see wether the project is totally new or "merely" updated.
I really like this solution and I've adopted this, works perfectly!
Little problem: $rec["atkoldrec"] is different from $rec in several ways,
generally it contains way less data in it (for instance in $rec
coordinator is a field composed only by "userid" whereas $rec["atkoldrec"]
has userid and name in it. This can be a problem for two reason:
1) it's quite difficult to build a
"isProjectUpdated($rec,$rec["atkoldrec"]) function that is aware of this
fact (and moreover you're going to modify this function it whenever you
add an attribute to the project class
2) it would be useful to be able to access to all the data that is stored
in $rec["atkoldrec"] (for instance, $rec["coordinator"]["name"]) without
having to make a new query to the database
maybe I don't have understood something in atk logic, otherwise i think
there could be a "bug" in atknode class (updateDb function)
I've not tried V.0.9.2 yet, but 0.9.1 seems to have the same problem.
Thanks a lot,
Pietro Ravasio
--
Pietro Ravasio <pietro.ravasio dot
System and Network Engineer
Abbeynet s.r.l. - http://www.abbeynet.it
TEL: +390702109044
FAX: +390702109013