Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1863 - Capture Field Activity Logs #1910

Merged
merged 5 commits into from
Feb 22, 2023

Conversation

kodinkat
Copy link
Contributor

Summary

  • fixes: Fields Activity Log #1863
  • communication_channel field type now captured within field_update activity logs.
  • connection field type still remains the same; as removal of from/to from connection field type column, will have a wider impact on functionality. Maybe, it would be best to tackle this within a separate dedicated ticket?
  • Analysis of field types also carried out to confirm consistency and structures as follows:
    • text:
      (
      	    [action] => field_update
      	    [object_type] => contacts
      	    [object_subtype] => nickname
      	    [object_id] => 536
      	    [object_name] => MAKE Contact
      	    [meta_id] => 8604
      	    [meta_key] => nickname
      	    [meta_value] => MAKE Stuff Pls
      	    [meta_parent] => unknown
      	    [object_note] => Nickname changed from "MAKE Stuff" to "MAKE Stuff Pls"
      	    [old_value] => MAKE Stuff
      	    [field_type] => text
      	)
      • date:
      (
      	    [action] => field_update
      	    [object_type] => contacts
      	    [object_subtype] => baptism_date
      	    [object_id] => 536
      	    [object_name] => MAKE Contact
      	    [meta_id] => 8667
      	    [meta_key] => baptism_date
      	    [meta_value] => 1673395200
      	    [meta_parent] => unknown
      	    [object_note] => Added Baptism Date: 1673395200
      	    [old_value] => 
      	    [field_type] => date
      	)
      • key_select:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => gender
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8668
             [meta_key] => gender
             [meta_value] => male
             [meta_parent] => unknown
             [object_note] => Added Gender: Male
             [old_value] => 
             [field_type] => key_select
         )
      • multi_select:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => milestones
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8669
             [meta_key] => milestones
             [meta_value] => milestone_has_bible
             [meta_parent] => unknown
             [object_note] => Added Faith Milestones: Has Bible
             [old_value] => 
             [field_type] => multi_select
         )
      • connection:
         (
             [action] => connected to
             [object_type] => contacts
             [object_subtype] => p2p
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 572
             [meta_key] => contacts_to_groups
             [meta_value] => 317
             [meta_parent] => 
             [object_note] => 
             [field_type] => connection from
         )
         (
             [action] => connected to
             [object_type] => groups
             [object_subtype] => p2p
             [object_id] => 317
             [object_name] => Metric Group
             [meta_id] => 572
             [meta_key] => contacts_to_groups
             [meta_value] => 536
             [meta_parent] => 
             [object_note] => 
             [field_type] => connection to
         )
      • number:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => number_test
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8671
             [meta_key] => number_test
             [meta_value] => 5
             [meta_parent] => unknown
             [object_note] => Added Number field: 5
             [old_value] => 
             [field_type] => number
         )
      • communication_channel:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => contact_other_c8a
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8682
             [meta_key] => contact_other_c8a
             [meta_value] => @other3
             [meta_parent] => unknown
             [object_note] => Added contact_other_c8a: @other3
             [old_value] => 
             [field_type] => communication_channel
         )
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => contact_other_c8a_details
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8683
             [meta_key] => contact_other_c8a_details
             [meta_value] => a:1:{s:8:"verified";b:0;}
             [meta_parent] => unknown
             [object_note] => contact_other_c8a "@other3" not verified
             [old_value] => 
             [field_type] => details
         )
      • tags:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => tags_test
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8674
             [meta_key] => tags_test
             [meta_value] => random
             [meta_parent] => unknown
             [object_note] => Added Random Tags: random
             [old_value] => 
             [field_type] => tags
         )
      • user_select:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => user_select_test
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8675
             [meta_key] => user_select_test
             [meta_value] => user-12
             [meta_parent] => unknown
             [object_note] => Added User Select: user-12
             [old_value] => 
             [field_type] => user_select
         )
      • location:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => location_grid
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8676
             [meta_key] => location_grid
             [meta_value] => 100134548
             [meta_parent] => unknown
             [object_note] => Added Locations: 100134548
             [old_value] => 
             [field_type] => location
         )
      • location_meta:
         (
             [action] => field_update
             [object_type] => contacts
             [object_subtype] => location_grid_meta
             [object_id] => 536
             [object_name] => MAKE Contact
             [meta_id] => 8677
             [meta_key] => location_grid_meta
             [meta_value] => 123
             [meta_parent] => unknown
             [object_note] => Hungary
             [old_value] => 
             [field_type] => location_meta
         )

@kodinkat
Copy link
Contributor Author

Once #1863 has been merged and closed, #1660 to be updated to support new activity log structural changes.

@corsacca
Copy link
Member

corsacca commented Jan 24, 2023

Connection field changes are not backwards compatible:
image

@corsacca
Copy link
Member

@kodinkat remind me what we were trying to do with the connection field rewrite?

1 similar comment
@corsacca
Copy link
Member

@kodinkat remind me what we were trying to do with the connection field rewrite?

@kodinkat
Copy link
Contributor Author

kodinkat commented Jan 26, 2023

@kodinkat remind me what we were trying to do with the connection field rewrite?

@corsacca The aim was to ensure the field_type activity column contained the correct connection entry - That was all, for now.

Shall we still proceed, with support for backwards compatibility; or revert back?

@corsacca
Copy link
Member

Connections:
We would like to keep backwards compatibility. So let's not change the form too much.
I wonder about changing the object_subtype from p2p to be the field key instead. Thaw would help in with a lot of details.
I think we can still figure out the key base on the connection to and connection from in the field_type column

@corsacca
Copy link
Member

First 2 p2p rows are the updated way.
second 2 are the default way:
image

@kodinkat
Copy link
Contributor Author

Updated connection field type activity record structure:

  (
     [action] => connected to
     [object_type] => contacts
     [object_subtype] => connection
     [object_id] => 536
     [object_name] => MAKE Contact
     [meta_id] => 572
     [meta_key] => contacts_to_groups
     [meta_value] => 317
     [meta_parent] => 
     [object_note] => 
     [field_type] => connection from
 )
 (
     [action] => connected to
     [object_type] => groups
     [object_subtype] => connection
     [object_id] => 317
     [object_name] => Metric Group
     [meta_id] => 572
     [meta_key] => contacts_to_groups
     [meta_value] => 536
     [meta_parent] => 
     [object_note] => 
     [field_type] => connection to
 )

@corsacca
Copy link
Member

@kodinkat connection is the field type. Which ideally would be stored in the field_type col.
I thought it would be helpful to store the field key like members or groups

@kodinkat
Copy link
Contributor Author

Updated connection field type activity record structure:

  (
     [action] => connected to
     [object_type] => contacts
     [object_subtype] => $from_field_key
     [object_id] => 536
     [object_name] => MAKE Contact
     [meta_id] => 572
     [meta_key] => contacts_to_groups
     [meta_value] => 317
     [meta_parent] => 
     [object_note] => connection from
     [field_type] => connection
 )
 (
     [action] => connected to
     [object_type] => groups
     [object_subtype] => $to_field_key
     [object_id] => 317
     [object_name] => Metric Group
     [meta_id] => 572
     [meta_key] => contacts_to_groups
     [meta_value] => 536
     [meta_parent] => 
     [object_note] => connection to
     [field_type] => connection
 )

@corsacca
Copy link
Member

Link type does not record anything in the field type column

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fields Activity Log
2 participants