Page MenuHomeIn-Portal Phabricator
  • Changed Files
  • branches/5.2.x/core/kernel/db/dbitem.php

INP-1789 - Teach "Changes Log" section to respect "kDBItem::Update" calls with limited field set
ClosedPublic

Authored by alex on Aug 13 2020, 5:12 AM.

Details

Test Plan

Preparations

  1. go to Admin Console
  2. go to ConfigurationWebsiteAdvanced section
  3. if "Track database changes to change log" setting is disabled, then enable it and logout

Part 1

  • in IDE:
    1. open "core/kernel/db/db_event_handler.php" file for editing
    2. locate "\kDBEventHandler::_update" method
    3. change "if ( $object->Update($id) ) {" line into "if ( $object->Update($id, array('l1_Translation', 'LastChanged', 'LastChangeIP')) ) {"
    4. save changes
  • in Admin Console:
    1. go to Website & ContentLabels & Phrases section
    2. open any record for editing
    3. change "Label" and "Phrase" fields
    4. save changes
    5. go to Logs & ReportsChanges Log section
    6. open record, that was just added
    7. confirm, that only changes to l1_Translation' and 'LastChanged' (optionally 'LastChangeIP') fields are shown there, because only they were saved into the database (only lines having "=>" represent a changed field value)

Part 2

  • in IDE:
    1. open "core/kernel/db/db_event_handler.php" file for editing
    2. rollback any changes to "\kDBEventHandler::_update" method made before
    3. save changes
  • in Admin Console:
    1. go to Website & ContentLabels & Phrases section
    2. open any record for editing
    3. change "Label" and "Phrase" fields
    4. save changes
    5. go to Logs & ReportsChanges Log section
    6. open record, that was just added
    7. confirm, that only changes to 'Phrase', 'PhraseKey', l1_Translation' and 'LastChanged' (optionally 'LastChangeIP') fields are shown there, because they were saved into the database

Part 3

  • in Admin Console:
    1. go to Website & ContentLabels & Phrases section
    2. add new record
    3. confirm, that record was added correctly and that action present in Changes Log
    4. delete added record
    5. confirm, that record was deleted correctly and that action present in Changes Log

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex created this revision.Aug 13 2020, 5:12 AM
alex requested review of this revision.Aug 13 2020, 5:12 AM
alex edited the test plan for this revision. (Show Details)Aug 13 2020, 5:13 AM
alex added a project: Restricted Project.
erik accepted this revision.Aug 17 2020, 5:42 AM
This revision is now accepted and ready to land.Aug 17 2020, 5:42 AM
This revision was landed with ongoing or failed builds.Dec 11 2020, 3:35 AM
This revision was automatically updated to reflect the committed changes.