Skip to content

Fixing issue with Media folder not being found in Umbraco > 7.5.14 #106

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

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

WarwickBuz
Copy link

Hi, Been having issues with updating files in Azure breaking links due to the folder number incrementing. This is as described here:

https://our.umbraco.org/forum/using-umbraco-and-getting-started/89715-unwanted-change-of-link-to-media

Found at that since 7.5.15 that Umbraco is expecting relative URL's in format 1000/ex.pdf as opposed to the older style of /media/1000/ex.pdf. As a result when Umbraco it goes to upload the file, it can't parse the older style relative URL to find the folder number and just creates a new one.

I've put in a version switch on the relative URL retrieval so that it will return the relative URL relevant to the Umbraco version.

Fixed our issues with 7.7.7 and Azure.

Cheers,

Warwick

@JimBobSquarePants
Copy link
Contributor

Thanks for the PR. I'm simply amazed Umbraco broke this without a major version.

@WarwickBuz
Copy link
Author

WarwickBuz commented Mar 22, 2018

Just realised in the code comment I said that versioning broke with 7.5.15 which doesn't exist. It was 7.6.0 that had the changes to the media URLs. Still a minor version!

@niallmccabe
Copy link

@JimBobSquarePants Do you have an idea of if/when this fix will be merged and released?

@Jeavon
Copy link
Collaborator

Jeavon commented May 16, 2018

Can someone please clarify if I'm correct in thinking that this doesn't stop anything working however it means that older versions of the media file are always left orphaned in blob storage when a media item is updated with a new file?

FYI In Umbraco terms, v7.6 was a major release and can have breaking changes, but of course they should be listed here https://our.umbraco.org/download/releases/760/ and I don't think it is. Does anyone know the specific commit that made this change?

@Jeavon Jeavon self-requested a review May 16, 2018 08:37
@niallmccabe
Copy link

@Jeavon It doesn't stop anything working but we've found that any links to media items added using the media picker and RTE still link to the original folder number. This means that those links must be updated manually.
Not sure of the specific commit that caused the change.

@niallmccabe
Copy link

Was just wondering if there is any update on this?

@ashallcross
Copy link

ashallcross commented Jul 13, 2018

Hi Jeavon...

Just curious as to if/when this could be reviewed/merged.

We have a client who is also experiencing the same issue?

Specifically...

'The issue seems to have started in V 7.6.0 after a change to the Umbraco core. The issue is that you are unable to update files in the media library; updating a document or image results in a new media folder being created and the old file left as-is. The diagnosis from someone was that the core was slightly changed resulting in the code that confirms that the referenced media folder exists, no longer finds it, so generates a new folder every time.'

Cheers

Adam

@Jeavon
Copy link
Collaborator

Jeavon commented Jul 13, 2018

Has anybody been able to track down the change in Umbraco that is the cause of this issue?

@ashallcross
Copy link

Hi Jeavon

Unfortunately no, we don't know which commit it was that broke this.

Cheers

@rbottema
Copy link

Hi all,

We are experiencing this issue as well. I've tried to dig through the commit history around v7.6 and I see large changes in for example MediaFileSystem.cs in this commit: umbraco/Umbraco-CMS@74e0a4d , although it might not be too helpful as it is a large 'review' commit.

Is there anything that is stopping this PR from being merged?

Cheers

@Jeavon
Copy link
Collaborator

Jeavon commented Jul 23, 2018

Either this is a bug in Umbraco that should be fixed (unlikely) or it's a undocumented breaking change that needs documenting and confirming as a change before this PR could be merged

public string GetRelativePath(string fullPathOrUrl)
{
var lastSafeVersion = new Version(7, 5, 14);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know the exact number? Without we cannot merge this PR as we might end up introduce a bug for older versions.

@JimBobSquarePants
Copy link
Contributor

If we can establish that it worked prior to 7.6 then I'm happy to get this merged.

@CasperTDK
Copy link

FYI #120 tests are being done

@JimBobSquarePants
Copy link
Contributor

Ok. Looks like the original version value is correct so I'm merging this.

@Jeavon would you be able to sort a proper release sometime soon? I'm not able to dedicate the time at the moment.

@JimBobSquarePants JimBobSquarePants merged commit 8aa6adb into umbraco-community:develop Oct 1, 2018
@Jeavon
Copy link
Collaborator

Jeavon commented Oct 1, 2018

@JimBobSquarePants sure, I can make a release this week

@rbottema
Copy link

Hi @Jeavon,

Sorry to bother you, but do you think you have time to make a release soon? We would like to integrate this fix in our projects the 'proper' way.

Cheers

@Newnab
Copy link

Newnab commented Nov 28, 2018

This is still affecting us too, would really value a release here.

@JimBobSquarePants
Copy link
Contributor

@Jeavon
Copy link
Collaborator

Jeavon commented Nov 28, 2018

Released in v1.0.3 :) Just went to lunch waiting for NuGet to index and you beat me to it :)

@Newnab
Copy link

Newnab commented Nov 28, 2018 via email

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

Successfully merging this pull request may close these issues.

8 participants