core icon indicating copy to clipboard operation
core copied to clipboard

Language missing on LiveCache when moving file assets

Open maurizo opened this issue 10 years ago • 3 comments

While moving (cut / paste) a file assets the system creates an entry on the livecache with null values on the language thus creating things like this: https://my.dotcms.com/tickets/detail.dot?id=6b72a347-40eb-42fd-9e5d-a5137d91b558

The problem comes from the use of addToLiveAssetToCache(Versionable) (https://github.com/dotCMS/core/blob/master-3.5/src/com/dotmarketing/cache/LiveCache.java#L56) on several parts of the code.

A partial solution might be to add language validation here (https://github.com/dotCMS/core/blob/master-3.5/src/com/dotmarketing/cache/LiveCache.java#L124) before adding the value to the map by using

if(languageId == null)
   languageId = ((Contentlet) asset).getLanguage();

maurizo avatar Apr 18 '16 14:04 maurizo

@maurizo is this causing any issues or just is sloppy code that needs fixing?

wezell avatar Apr 18 '16 15:04 wezell

@wezell doesn't seem to be creating mayor problems, at least is not reported by the client as such. We might be doing an extra hit on the cache after the asset is moved but that is all.

maurizo avatar Apr 18 '16 15:04 maurizo

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

stale[bot] avatar Sep 29 '19 22:09 stale[bot]