Forum OpenACS Q&A: Was SDM's audit ever working?

Collapse
Posted by Krzysztof Kowalczyk on
I was annoyed by audit not working in SDM so I've fixed it. It was suspiciously easy so I thought that I will ask which one is true:
  • this functionality was never finished (this is what source suggests)
  • it was working at some time and for some reason fixing is more tricky that it seem
Collapse
Posted by Ben Adida on
Can you elaborate? I'm responsible for that module and any
associated screwups, and the audit stuff was working on my
end. It's not impossible that some SQL I entered into my data
model got somehow ommitted from the release (and I guess
our testing needs to be improved). This should not be too
complicated to fix, though, so please send more details.
Collapse
Posted by Krzysztof Kowalczyk on
In the order of appearance:
  • in 3.2.4 column "BY" in audit page is always empty (it's also the case on OpenACS site). The reason for that is that the trigger that updates baf_audit name column gets the name from bugs_and_features.last_modified_by. The problem is that last_modified_by is never set. The fix is to set this to $user_id in a few places (all INSERTs and UPDATEs into bugs_and_features table)
  • when you fix that you'll notice that the trigger trig_baf_audit in sdm.sql is always late by one person, ie. it uses OLD.last_modifed_by instead of NEW.last_modified_by
Collapse
Posted by Ben Adida on
Yes, that part was indeednever working. The rest of the auditing should be working, though. Glad to see this fixed :)