Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defeat Audit Trail Updates @ MRP? - SOLVED
10-28-2018, 09:59 PM (This post was last modified: 10-28-2018 10:54 PM by VortecCPI.)
Post: #1
Defeat Audit Trail Updates @ MRP? - SOLVED
I noted when running MRP the AuditTrail table gets filled with entries making SQL backup files HUGE. It sure would be nice to be able to choose this as an option for MRP as it does not actually affect data in the ERP system -- That must be done manually.

Is there any way to defeat Audit Table updates via a change to MRP.php code?

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
10-28-2018, 10:26 PM
Post: #2
RE: Any Way to Defeat Audit Trail Updates?
Yes, this should be easy.

In the file includes/ConnectDB_mysqli.php (or whichever DB type you are using) change the line:

if (isset($_SESSION['MonthsAuditTrail']) and (DB_error_no($db) == 0 and $_SESSION['MonthsAuditTrail'] > 0)) {

to be:

if (isset($_SESSION['MonthsAuditTrail']) and (DB_error_no($db) == 0 and $_SESSION['MonthsAuditTrail'] > 0) and basename($_SERVER['SCRIPT_NAME']) != 'MRP.php') {

This should ignore any updates/inserts from that script.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
10-28-2018, 10:39 PM
Post: #3
RE: Defeat Audit Trail Updates @ MRP?
Thank you so much Tim!

I am preparing a demo for one of my customers and they have concerns about webERP support. As usual, and as I have told them, this forum and its leaders ALWAYS come through for any needs.

The demo will include the Work Centers added to MRP for use on Work Orders as in this thread: http://www.weberp.org/forum/showthread.php?tid=2117

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
10-28-2018, 11:04 PM
Post: #4
RE: Defeat Audit Trail Updates @ MRP?
What I normally do is to use the --ignore-table switch in mysqldump to ignore the audittrail table while doing regular backups and then backup that table separately on a less frequent basis. It all depends on the companies backup policies.

I haven't time at the moment to look through your work centre code - things are very busy right now. I was hoping someone else would pick it up and review it.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
10-29-2018, 02:37 AM
Post: #5
RE: Defeat Audit Trail Updates @ MRP? - SOLVED
Tim -- Another good idea and I can just adjust the scrips called by CRON jobs -- Thank you so much.

My personal opinion is that since MRP does not change anything with respect to critical data in webERP we can just ignore it.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
10-29-2018, 09:37 PM
Post: #6
RE: Defeat Audit Trail Updates @ MRP? - SOLVED
I noticed some minor small differences when comparing ConnectDB_mysql.php to ConnectDB_mysqli.php.

Does it make sense to reconcile these two files so they are a bit more consistent?

This is in 4.14.1 so perhaps already done in 4.15.1?

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
10-30-2018, 01:37 AM
Post: #7
RE: Defeat Audit Trail Updates @ MRP? - SOLVED
The php mysql extension is deprecated and unmaintained for years. We left it in because some hosting companies are pathetically slow in uodating these things, but we must be getting to the point where we remove ConnectDB_mysql.php

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)