Outstanding question/Business Impact
Customer wants to know why did the cm:tagScopeCache property is set to NULL instead of being totally removed like cm:tagScopeSummary property when tag scope count is set from > 0 back to 0? Is this by design behavior or bug?
This behavior has caused the customer's custom script for not able to run properly at all time due to the NULL value.
Current observed product design
cm:tagScopeCache properties is part of cm:tagScope aspect which is added to all Site node by default.
When a new site is created, cm:tagScope aspect is applied by default. One do not see any cm:tagScopeCache and cm:tagScopeSummary property associate to st:site node until first tag is being created for any of the site content under Site Document Library.
When site user create the first tag for any of the content/folder node within Site nodes, one will see Site Node properties has two new properties added:
If you remove all tags from folder child node within the Site (st:site) node, it will read then change to:
If you then add the tag back to it, it will display the cm:tagScopeCache with content url and cm:tagScopeSummary again with the updated tagScopeSummary.
Steps to reproduce
- in 220.127.116.11, deploy custom model into your Alfresco from FTP location.
- Login to Alfresco Share and create a new site.
- Double check in Node Browser that the site node does not have cm:tagScopeCache properties.
- Navigate to the newly created site, add content and folder under site document library, add a new tag to either content or folder item.
- Double check in Node browser that the site node now does have cm:tagScopeCache properties.
- Next, delete the previously created tags from the site > document library > folder/content node(s).
- Double check in Node Browser that the site node now have cm:tagScopeCache properties modify to 'null' while cm:tagScopeSummary properties is removed.
- Expected: Script run failed with an error returned: Object cannot be null.
- Actual: Script run failed as expected, with error:
Root Cause Analysis
the NullPointerException error relevant to cache, I validated this null value for cm:tagScopeCache being the root cause after tested following workaround.
- Add a new tag back to any site node child folder/content.
- Double check the cm:tagScopeCache properties value on site node is now changed from null to contentURL value and there are no other properties fields with NULL value.
- Now. rerun the same custom js script which failed previously.
- Expected: The script should run without problem this time once we remove the null value from site node properties
- Actual: Script does run successfully.