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

Individual Media URL #62

Closed
a-t-k opened this issue Oct 19, 2019 · 7 comments
Closed

Individual Media URL #62

a-t-k opened this issue Oct 19, 2019 · 7 comments
Assignees

Comments

@a-t-k
Copy link

a-t-k commented Oct 19, 2019

I have two Umbraco 8+ installations on a server. Both are hosted and routed under IIS. For example, uSinc8 does not properly adapt images to the target stage. It still remains in the .config file containing the old URL.

It would be quite good if the desired URL under the configuration in UI can be entered in an input field. This value can then be inserted into the .config file during import.

An example:

<umbracoFile>
  <Value>{"src":"/data/cms/media/rkkbxwun/image_mini.jpg","crops":null}</Value>
</umbracoFile>
@KevinJump
Copy link
Owner

KevinJump commented Oct 19, 2019

Hi

not quite sure what you mean.

the default uSync behaviour is to copy the media config (the stuff that ends up in the DB), The actual media files in the media folder. should be copied over separately - so the structure of that folder will be the same on both source and target sites?

I don't think it shouldn't have more than /media in the config (unless you have moved the media folder in the Umbraco config ?)

having said all that, if there is something unique and you do want to change the values, then you could have a ValueMapper for the media image (in the case above that would be for the ImageCropper). that could then do something with the media folder path before and after import?

does that make sense ? or have i missed the point !

@KevinJump
Copy link
Owner

@a-t-k
Copy link
Author

a-t-k commented Oct 19, 2019

There are two different installations of Umbraco. Each installation has its own media path. (are different)

After importing the exported Media .config files, the URLs are still the old ones.

The goal here would be to replace the location in the .Config file with the new value.

from:
" /data/cms/media/ imageRandomFolder/imageName.jpg"

to:
" /stage/cms/media/ imageRandomFolder/imageName.jpg"

@KevinJump
Copy link
Owner

So are the two installations in virtual directories of the same IIS Site?

just trying to understand where the /data/cms and /stage/cms are coming from because it should be /media (and thats what i am seeing on my installations).

if we can work out the config, then maybe we can put some mitigation in.

@a-t-k
Copy link
Author

a-t-k commented Oct 19, 2019

Well,
IIS virtual directory is "/data/cms". Configuration of Umbraco per default use "/media".

after exporting the media with uSync8 the .config file looks like this

<umbracoFile>
<Value>{"src":"/data/cms/media/rkkbxwun/image_mini.jpg","crops":null}</Value>
</umbracoFile>

All Images will be use this URL "https://domain/data/cms/media/rkkbxwun/image_mini.jpg"

But for the two installations we have two different paths for the media data. Thus, the references after import are still the old ones. The problem also arises when the path to the media will change for some reason. Or, we would like to create a test environment that has its own media folder path.

KevinJump pushed a commit that referenced this issue Oct 20, 2019
Removes/Adds the subfolder path from the media file location, when exporting/importing images.
@KevinJump
Copy link
Owner

need to do a little testing but bc292f0 should do this by removing the SystemDirectories.Root value from the path on export and putting it back on import

I just need to confirm it doesn't break different types on installations before putting it into release.

@a-t-k
Copy link
Author

a-t-k commented Oct 21, 2019

Yes,
that looks good.
Thank you for the fast implementation.

At the moment we are transforming the .config files in our CD-Process.

With the new implementation, the responsibility would be in the right place and our CD-Process will be cleaner.

@KevinJump KevinJump added this to the 8.2.4 - Patch Release milestone Oct 21, 2019
@KevinJump KevinJump self-assigned this Oct 21, 2019
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

No branches or pull requests

2 participants