Skip to content

[bug] Automatic movement record not created when a storage location is moved #1923

Description

@poplarmedia

I am using a MacOS Homebrew as a dev environment with Apache, MariaDB, and PHP 8.3. The codebase is Providence dev/2.0 branch.

I am following the documentation here:
https://docs.collectiveaccess.org/providence/user/workflow/history_tracking_current_value

I have set record_movement_information_when_moving_storage_location = 1 and successfully tested a current_location history-tracking policy in ...conf/local/app.conf. When I move a storage location like a box or a cabinet from one room to another, it does not create movement record, and the move is not tracked in the logs of the objects. The box moves successfully, the objects in the box move correctly, the objects move inside to the new location as well, but nothing is updated beside the location:

  • Time stamp on the object does not change from last manual update,
  • The object log does not show the change in location.
  • The storage container log updates with a geo-reference change, no other details.
  • History tracking – chronology does work to move an object, and shows it in the log
  • Move is not generated, is not findable in search

I did some testing and I think its is in ca_storage_locations::saveBundlesForScreen(), Where the movement tracking runs, $old_parent_id and $new_parent_id are equal on every move, so the guard that skips tracking when there is "no actual movement" fires every time and tracking is never reached.

See this line of code in app/models/ca_storage_locations.php

if ($old_parent_id === $new_parent_id) { return $rc; } // don't track if there's no actual movement

I added some logging and got this result on several move attempts

SBFS-DECIDE rc=true pc=true old=8   new=8
SBFS-DECIDE rc=true pc=true old=177 new=177
SBFS-DECIDE rc=true pc=true old=22  new=22

Steps to reproduce

  1. Configure current-location history tracking with a ca_movements policy element
  2. Open a storage location with objects inside
  3. Using the hierarchy_location bundle, go to the Move tab to select a different parent location.
  4. Movement form appears below
  5. Fill in the Movement details form and save.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions