1.8rc3 storage location current contents

I have 1.8rc3 installed on 3 test systems

  • Windows11 with WAMP server
  • A Ubuntu 20.04 V3 installation in Oracle VM Virtual box
  • A test version on my live (shared hosting) server

We were using workflow based location tracking.

We are trying to implement the new history tracking.

This works fine for objects at the moment, but I cannot get the current contents for storage locations working.

It always comes up empty.

I am using the bundle : history_tracking_current_contents

If an object is directly related to a storage location, I can see the content using the bundle ca_objects, but that gives me no information on current locations based on the history tracking.

In the object display I do get the correct current storage location in both the info box and the history_tracking_chronology bundle

«1

Comments

  • Hi,

    Try running caUtils reload-current-values-for-history-tracking-policies to reload the current location index. The info box derives the current location directly from data so it'll display correctly even if the index is wrong. Browsing and current contents rely upon the index.

    Let me know if this doesn't resolve the issue and we'll move onto other possible causes.

    Seth

  • Hello Seth,

    I ran caUtils reload-current-values-for-history-tracking-policies

    It does not seem to resolve the issue.

    I did only run cautils on my live test system for the momen as I have not found a way yet to run the command on my local WAMP server.

    I will do some more tests next monday.

  • edited December 2021

    Ok. At some point perhaps I can take a look at the installation. There's quite a lot of configuration required to make it work, and perhaps something is off there.

  • Hello Seth,

    I have created two new test installations, one with the cdwa lite profile and one with the testing profile.

    After creating some testing content and adapting some metadata ( a date range value for occurences) and adding some itemes to the GUI

    I still do not get any results in the bundle history_tracking_current_contents for storage locations.

    I did run caUtils reload-current-values-for-history-tracking-policies

    several times.

    I get the impression it is not specifically related to my installation profile. (as i also get empty results with other profiles)

    This is my setup for history tracking in app.conf (in the local directory):

    history_tracking_policies = {
           defaults = {
                   ca_objects = current_location
           },
           policies = {
                   current_location = {
                           name = _(Current location),
                           table = ca_objects,
                           elements = {
                                   ca_storage_locations = {
                                           __default__ = {
                                                   date = ca_objects_x_storage_locations.effective_date,
                                                   setInterstitialElementsOnAdd = [effective_date],
                                                   useDatePicker = 0,
                                                   color = #F5B7B1,
                                                   template = "<l>^ca_storage_locations.hierarchy.preferred_labels.name%delimiter=_➜_</l> <ifdef code='ca_objects_x_storage_locations.movement_by'> <br>MOVED BY: ^ca_objects_x_storage_locations.movement_by</ifdef> <ifdef code='ca_objects_x_storage_locations.movement_comments'> <br>COMMENTS: ^ca_objects_x_storage_locations.movement_comments</ifdef>",
                                                   trackingRelationshipType = related,
                                                   restrictToRelationshipTypes = [related, permanent, temporary],                                               
                                           }
                                   },
                                   ca_occurrences = {
                                           __default__ = {
                                                   date = ca_occurrences.exh_dates,
                                                   setInterstitialElementsOnAdd = [effective_date],
                                                   template = <unit relativeTo='ca_occurrences'><unit relativeTo='ca_storage_locations'><ifdef code='ca_storage_locations.idno'><b>Locatie: <l>^ca_storage_locations.idno</l></b><br/></ifdef></unit>Gebeurtenis:<l> ^ca_occurrences.preferred_labels</l><br></unit>,
                                           }
    
                                    },
                                    ca_loans = {
                                           __default__ = {
                                                   date = ca_loans_x_objects.effective_date,
                                                   setInterstitialElementsOnAdd = [effective_date],
                                                   color = F78B8B,
                                                   template = <l>^ca_loans.idno</l> ^ca_loans.preferred_labels (^ca_loans.institution ^ca_loans.date) <ifdef code='ca_loans_x_objects.movement_comments'> <br>COMMENTS: ^ca_loans_x_objects.movement_comments</ifdef>,
                                                   restrictToRelationshipTypes = [loan]
                                           }
                                       }
                                   }
                           }
          }
    }
    

    Would the problem be in an error in there somewhere?

    I also tried the history_tracking_policies example for workflow from the 1.8 manual.

    I must add that I have had problems getting related objects displayed in storage locations using the ca_objects bundle previously too

  • edited December 2021

    I have made some changes to history_tracking_policies in my local app.conf:

    history_tracking_policies = {
           defaults = {
                   ca_objects = current_location
           },
           policies = {
                   current_location = {
                           name = _(Current location),
                           table = ca_objects,
                           elements = {
                                   ca_storage_locations = {
                                           __default__ = {
                                                   date = ca_objects_x_storage_locations.effective_date,
                                                   setInterstitialElementsOnAdd = [effective_date],
                                                   useDatePicker = 0,
                                                   color = #F5B7B1,
                                                   template = "<l>^ca_storage_locations.hierarchy.preferred_labels.name%delimiter=_➜_</l> <ifdef code='ca_objects_x_storage_locations.movement_by'> <br>MOVED BY: ^ca_objects_x_storage_locations.movement_by</ifdef> <ifdef code='ca_objects_x_storage_locations.movement_comments'> <br>COMMENTS: ^ca_objects_x_storage_locations.movement_comments</ifdef>",
                                                   trackingRelationshipType = related,
                                                   restrictToRelationshipTypes = [related, permanent, temporary],                                               
                                           }
                                   },
                                   ca_occurrences = {
                                           __default__ = {
                                                   date = ca_occurrences.exh_dates,
                                                   setInterstitialElementsOnAdd = [effective_date],
                                                   template = "<unit relativeTo='ca_occurrences'><unit relativeTo='ca_storage_locations'><ifdef code='ca_storage_locations.idno'><b>Locatie: <l>^ca_storage_locations.idno</l></b><br/>vanwege gebeurtenis:<br/></ifdef></unit><l> ^ca_occurrences.preferred_labels</l><br></unit>",
                                           }
                                    },
                                    ca_loans = {
                                           incoming = { 
                                                   date =   loan_term,
                                                   color = #E5E8E8,
                                                   template = "<unit relativeTo='ca_loans'><unit relativeTo='ca_storage_locations'><ifdef code='ca_storage_locations.idno'><b>Locatie: <l>^ca_storage_locations.idno</l></b><br/>vanwege:<br/></ifdef></unit>Inkomende lening: ^ca_loans.preferred_labels (^ca_loans.idno)</unit>"
                                           },
                                           outgoing = { 
                                                   date =   loan_term,
                                                   color = #EAFAF1,
                                                   template = "<unit relativeTo='ca_loans'><unit relativeTo='ca_storage_locations'><ifdef code='ca_storage_locations.idno'><b>Locatie: <l>^ca_storage_locations.idno</l></b><br/>vanwege:<br/></ifdef></unit>Uitgaande lening: ^ca_loans.preferred_labels (^ca_loans.idno)</unit>"
                                           }
                                       }
                                   }
                           },
               }
    }
    

    I do get results for the history_tracking_current_contents in the occurences editer and the loans editor (after adding the bundle to the UI),

    but still no results for the bundle in storage locations.

    Would this be caused by the objects being directly related to the occurence/loan and the objects would be related to the storage location by a relation to either loan or occurence?

    I did in the meantime also found the way to run caUtils on my local WAMP server installation.

  • Hello Seth,

    You mentioned in december that there's quite a lot of configuration required to make it work.

    Could you elaborate on that?

    Are there other configuration files that need to be adapted? (I have made changes to search_indexing.conf)

    My current "production" version is 1.7.11, and as in my test for 1.8 I do get the correct results in the object history etc. but no results in the storage location current contents.

    I do realize 1.7.11 uses the old location tracking and 1.8 uses history tracking (at least in my setup), but in both cases the result for current contents for Storage location is empty.

  • Have you looked at this page? https://manual.collectiveaccess.org/workflow/location.html

    This covers the required configuration. Let me know if any (or all :-) of it is confusing or needs improvement.


    thanks

    Seth

  • edited March 4

    Hello Seth,

    I have looked at that page, and also (for older versions) at this page: https://docs.collectiveaccess.org/wiki/Location_tracking

    I did not think the pages were confusing, I just thought maybe getting the current contents for a storage location record needed something (additional configuration) not mentioned in those pages .

    I have made all the mentioned adjustments in app.conf, browse.conf and search_indexing.conf.

    As mentioned before location tracking or history tracking works for everything exept for the current contents bundle for the Storage location.

  • Hello Seth,

    Are you using one of the standard profiles for testing developement, and if so wich one would that be?

    Would that also be the profile that the examples in the documentation are based on. (if not what would that profile be?)

    I would like to try to setup a test system that has the same setup used in the documentation. I think that would make it easier for me to understand the changes I have to make in my production setup.

  • I test with the DublinCore profile, the demo and with a small set of user data I have handy. Most testing is with develop code though, which for this feature is totally different than in 1.7.x

    Current contents works for me in both 1.7 and 1.8. I've tried them just now. For 1.7.x you should make sure the current_contents bundle is set to track via object-location relationships (see screen shot). For 1.8, make sure the current location cache is up to date by running, on the command line via caUtils, reload-current-values-for-history-tracking-policies

    Eg. from the support/ directory run bin/caUtils reload-current-values-for-history-tracking-policies

  • edited March 11

    I have setup a test system with the testing profile. (As far as I can see based on DublinCore with some additions)

    I installed version 1.7.14

    I have made some changes:

    • I have added a date field for a period (loan_period) and a storage location relationship to Loans. Loan types are in and out
    • I have added a date field for a period (date_occ) and a storage location relationship to Occurences. Occurence type is only one: event.
    • I have added a storage location relationship to Movements. Movement type is only one: movement.

    This my setup in app.conf (in the local directory)

    # Direct object-location reference storage location tracking
    # also set this for movement-based storage location tracking)
    # ---
    #
    object_storage_location_tracking_relationship_type = related
    #
    # ---
    # Movement-based storage location tracking
    # ---
    #
    movement_storage_location_tracking_relationship_type = related
    movement_object_tracking_relationship_type = part
    record_movement_information_when_moving_storage_location = 1
    movement_storage_location_date_element = removal_date
    
    current_location_criteria = {
       ca_storage_locations = {
                   related = {
                           color = #F5B7B1,
             template = ^ca_storage_locations.idno<br/><l>^ca_storage_locations.idno</l>: permanent
          }       
       },
       ca_movements = {
                   movement = { 
                       date = removal_date, 
                       color = #D4E6F1, 
                   }
       },
       ca_loans = {
          in = { 
             date =   loan_period,
             color = #E5E8E8,
          },
          out = { 
             date =   loan_period,
             color = #EAFAF1,
          }
       },
       ca_occurrences = {
          event = {                        
             date = date_occ,
             color = #D2B4DE,
          }
       },
       # The entry for ca_objects controls if and how deaccessions are displayed
       ca_objects = {
          template = ^ca_objects.deaccession_notes (^ca_objects.deaccession_date),
          color = cc0000
       }
    }
    
    

    I ran bin/caUtils reload-object-current-locations and tried to run

    php bin/caUtils reload-object-current-location-dates wich gave me some error messages:

    Warning: Illegal string offset 'start' in F:\wamp64\www\CA1714Dublin\app\lib\Utils\CLIUtils.php on line 3253
    
    Warning: Illegal string offset 'end' in F:\wamp64\www\CA1714Dublin\app\lib\Utils\CLIUtils.php on line 3253
    
    Fatal error: Uncaught DatabaseException: Incorrect decimal value: 'A' for column 'sdatetime' at row 1 in F:\wamp64\www\CA1714Dublin\app\lib\Db\mysqli.php:316
    Stack trace:
    #0 F:\wamp64\www\CA1714Dublin\app\lib\Db\DbStatement.php(151): Db_mysqli->execute(Object(DbStatement), Object(DbStatement), 'UPDATE ca_movem...', Array, NULL)
    #1 F:\wamp64\www\CA1714Dublin\app\lib\Db.php(259): DbStatement->executeWithParamsAsArray(Array, NULL)
    #2 F:\wamp64\www\CA1714Dublin\app\lib\Utils\CLIUtils.php(3253): Db->query('UPDATE ca_movem...', Array)
    #3 F:\wamp64\www\CA1714Dublin\support\bin\caUtils(167): CLIUtils::reload_object_current_location_dates(Object(Zend_Console_Getopt))
    #4 {main}
     thrown in F:\wamp64\www\CA1714Dublin\app\lib\Db\mysqli.php on line 316
    


  • I have created a loan for one object, an occurence for another and a movement for a third.

    In the object use history bundle they register (are displayed), but in the current location bundle they are not. (see screenshots)

    The current contents bundle for Storage location only registers a direct object-storage location relation if i set it to track via object-location relationships, and only the movement if set to track via movements.

    It must be something I am missing, but it would be really helpfull to get the current contents for storage locations working as we have to do an inventory of the depot in about two weeks, and it would make things a lot easier if we could start by checking the shelve contents to the current contents in collective access.

    1001 x 1054 - 135K
    1001 x 1054 - 135K
    1000 x 1153 - 115K
  • edited March 11

    I did check the Mysql database.

    The objects concerned do have an entry in the field current_loc_id.

  • What is the relationship type between the location and object in the example?

  • For a direct object ⇔ storage location the relationship is: related

    For a loan it is: loans ⇔ objects relationships = loan and then loans ⇔ storage locations relationships = related

    For an occurence it is: object ⇔ occurrence relationships = depicts or describes or used and then occurrences ⇔ storage locations relationships = related.

    For a movement it is: movements ⇔ objects relationships = part and then movements ⇔ storage locations relationships = related

  • Is the location in the example actually using that relationship type? It might be easier for me to look at the installation directly – there are lots of reasons this might not be working for you.

  • It is a local installation on my local machine windows 11 with WAMP server, so looking at the installion directly would not be practically possible i think.

    I could send you a database copy/export, or set up an example on my live server.

    I have 4 different situations.

    One object uses direct location relationship. relation= related

    One object uses a loan. Relationships: 1st loan, 2nd related

    One object uses occurence. Relationships: 1st depicts, 2nd related

    Three objects use movement. Relationships: 1st part, 2nd related

  • Yes, please send me a dump of the database and a copy of all local config files and I'll see what the issue is.

  • edited March 11

    Hello Seth,

    If I am right you only need the files in app/conf/local?

    I will also send them by email.

  • only app/conf/local

  • Thanks for the data. I've tried your set up out and current contents works as it should (for 1.7). The problem is that you're mixing object use history and current location bundles, expecting them to do the same thing and in 1.7 they don't. Use history pulls all records according to current_location_criteria, while the "current_location" bundle only pulls storage locations, either via object-location relationships or via movements. Current contents bundles in 1.7 only take into account location relationships (direct or via movements) as well. Loans, occurrences, etc can show up in the use history and in the "current" heading in the editor inspector panel, but not in those older "current_location" and "current_contents" bundles.

    It's confusing, I know, which is why it was completely redone in the v1.8/develop codebase as more generic history tracking functionality that can handle tracking and display of many more types of relationships (including loans, occurrences and collections), has a notion of "home" location and can implement multiple tracking policies simultaneously. All of the available bundles work tandem in 1.8. The documentation at https://manual.collectiveaccess.org/workflow/location.html refers to the 1.8 system.

  • edited March 13

    Hello Seth,

    Thanks for the effords, I understand the difference now. It was not clear to me based on the documentation (for 1.7)

    I can see 2 approaches to getting the info I need for the inventory:

    • Upgrade to 1.8 and sort it out there. That might take too much time, and last time I checked there was still an issue with conditional formatting. I have a post concerning that (https://collectiveaccess.org/support/index.php?p=/discussion/301040/1-8rc3-summary-display-conditional-template#latest). We use conditional formatting to create labels with a QR code on the objects, and in order to have the right ownership registered we need the conditional formatting.
    • Create movements as duplicates for loans and occurences so the current contents can be displayed for the storage locations. It will be a lot of manual work, but I think in a few days I could have them all converted, wich would be in time for the inventory.
  • Re 1.8 that conditional error should no longer be an issue.

    Re: using 1.7, so the issue comes down to "current location" not showing loans and occurrences? I would prefer to figure out a solution that doesn't involve duplicating data.

  • edited March 13

    About 1.8: I will look into that. I started the post with isues in 1.8rc3 so I will check if those isues are resolved.

    About 1.7: I agree it is not a preferred solution, especially since I am working toward upgrading to 1.8 as soon as issues are sesolved, but in the timeframe it might be the smartest/safest solution to get things working. I can delete the duplicated movement items once it is resolved. (Or would that still be an issue)

    I will be on the road tomorrow all day, so first time to check solutions would be on next tuesday.

  • As I have your set up I will see if there's a solution in 1.7 that will keep you for now. More soon.

  • The setup that I did send you is a test system.

    My actual live system is a bit more complicated.

    I did previously send you access to that. That access is still valid.

  • We have discussed the options today and we have decided to take a chance upgrading to 1.8.

    The latest release candidate is 1.8RC5 I believe, or should I download 1.8?

    If we find issues we cannot resolve, we can always revert to 1.7.14 or not?

Sign In or Register to comment.