Copied FileAssets not indexed..
To reproduce using demo site: 1.create copy directory /images/templates into /images/icons
- create template "asset copy test" with
set($showSubgalleryTitle=false)
set($showPhotoTitle = false)
set ($thumbnailWidth = "150")
set ($thumbnailHeight = "150")
< h1> EXISTING assets </h1>
photoGallery("/images/template")
</hr> < h1> COPIED assets </h1>
photoGallery("/images/icons/template")
-
create html page "asset_test.html" with this template
-
view page - shows all from existing, NONE from COPIED. (view as admin, otherwise broken links shown for images)
-
rebuild fileAsset index and view page again.
COPIED assets are now visible.
Great - that was fast :) Does this fix indexing when copying just a fileAsset or just when copying an entire folder ? I've experienced the same problem when just copying a single image from one folder to another... would that perhaps involve FileAssetAPIImpl.java.. or FileAPIImpl.java-s "copy" functions? (still working my way through the codebase... )
would it not be more efficient to reindex only the target folder after copying.. ie (for FolderFactoryImpl.java)
APILocator.getContentletAPI().refreshContentUnderFolder(newFolder);
I've tested locally and this seems to work fine, also similar logic for BrowserAjax.java: using:
APILocator.getContentletAPI().refreshContentUnderFolder(parent);
instead of the reindex(structure) call in both places to reindex all fileAssets..
I do not see this working on master. I even started clean starter, did complete re-index and did whole process again and could not get it to work. I got same results as original bug report... only saw copied assets after re-index. Reporting new issue: https://github.com/dotCMS/dotCMS/issues/1685