-
Notifications
You must be signed in to change notification settings - Fork 2
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
Relative FilePath for AssetFiles is different than for Media_File.DataSourcePath #75
Comments
@bluemodus-mwills I think this is related to this thing: I also noticed that in your import console app you need to set both paths. |
@diger74 - I have both paths set, but to be clear: When importing media library images using UMT, I was allowed to set the current directory to the location of my import files instead of the WebApplicationPhyiscalPath. That was convenient, because it allowed the FilePath property in my JSON files to use a relative path. However, when importing asset files, the current directory must be the WebApplicationPhysicalPath. The logic between importing media files and content assets seems to be different. |
Hi @bluemodus-mwills, yes this is how content item asset import behaves now. It is unfortunately not related to UMT, but rather to how XbyK API behaves. I will create reproducible sample and forward issue. Lets keep this open to track progress. |
Thank you, @tkrch |
Currently only available solution is to change CurrentyDirectory to XbyK directory and break relative paths in models. Solutions are still being discussed. I can't call From perspective of UMT i see possible solution:
|
Thank you, @tkrch. I'm currently using your first suggestion, and it works. My app for importing JSON with UMT is resolving relative paths before importing them. Thanks again! Maybe all we need for UMT is to document this sa requirement. |
Describe the bug
When importing medial files exported using the Sitecore Migration Tool, I discovered that the folder context is different when importing Media_Files vs AssetFiles.
To Reproduce
Steps to reproduce the behavior:
Import Json serialized Media_File objects using relative FilePaths like this:
".\Files\NEWSWIRE\thumbnails24\1NPHW.png"
Import Json serialized AssetFile objects using relative DataSourcePath like this:
".\Files\NEWSWIRE\thumbnails24\1NPHW.png"
Result
When importing Media_File objects, the files will be imported using the root of the target CMS project's WebApplicationPhysicalPath.
When importing AssetFiles object, the files will be imported using the environment, current directory.
When importing content using UTM, this causes the asset folder to be created in the same directory as the JSON and medial files exported by the Sitecore migration tool, instead of in the WebApplicationPhyiscalPath/assets folder.
Work around
Update the AssetFile.FilePath of all assets to be an absolute path, so that the current directory can be the same as the WebApplicationPhysicalPath. This prevents the assets from being added to the wrong folder while being imported.
Expected behavior
When assets are imported, files should be saved under the WebApplicationPhyiscalPath not under the Envirobment.CurrentDirectory.
The text was updated successfully, but these errors were encountered: