Umbraco-CMS: Media tree doesn't show folders in 7.15.0 any more for folders created before 7.8.0
See for original report: https://our.umbraco.com/forum/using-umbraco-and-getting-started/98092-umbraco-715-media-folders-not-appearing-in-the-tree
In 7.8.0 we introduced a new table cmsMedia in which all media items get populated when they have a mediaPath - sadly, media items of type Folder do not have a path so they never got into the cmsMedia table during the upgrade.
This was no problem until we introduced this part of the query:
An INNER JOIN on cmsMedia will exclude the old Folders from being return since they do not exist in cmsMedia. When changing this query to a LEFT JOIN, the media tree returns to normal.
Workaround if you are already on 7.15.0 and need to fix your media tree right now
The complete SQL script that works great is in this comment, it has been updated after some tests came in and it is now complete: https://github.com/umbraco/Umbraco-CMS/issues/5848#issuecomment-510801892
This item has been added to our backlog AB#1714
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 27 (16 by maintainers)
Sure, there you go: đ
This is a reasonably large problem for users. Perhaps HQ needs to highlight this issue on the 7.15.0 release page on Our ?
I feel that this is a serious issue that needs to be fixed in a patch update or hotfix as soon as possible.
A 7.15.1 release will have to wait a little longer.
If you need to fix it now, make sure to roll back to either 7.14.0, use the build output from the related PR.
Considering that there should be massive amount of sites out there that is affected by this issue, I would say that a releases hot fix would be preferable. Modifying the DB manually feels like the wrong fix. I would REALLY like that the 7.15.1 release got closed and shipped. That said, I would prefer to upgrade via Nuget.
In our case we updated 12 sites, after reading about the update before the warning came up. We obviously didnât return to the releases-page after that.
So, I thought screw it. Iâm going to remove the âparentId = -1â in the first select query⌠And it fixes all my problems with the folders. Now all are showing đ
As a workaround, we can populate the
cmsMediatable with some SQL. Note, this is mostly untested, make backups and copy the output of this script to make sure you can revert the INSERT statement if needed laterWhat does it do? It finds all nodes of type
'B796F64C-1F99-4FFB-B886-4BF4BC011A9C'(media types) that are not yet in thecmsMediatable.It then loops through each of them and finds the newest version in the
cmsContentVersiontable. Then it inserts thenodeIdandversionIdincmsMediawhich will then ensure it ends up in the media tree again as it is part of theLEFT JOINquery again,Did I tell you to make backups? And copy the output?
In the output you should see the result of the first
SELECT(in my case 5 items,(5 rows affected)) and then for each item theversionIdand thenodeIdthat are inserted intocmsMedia.Ps. Make backups!
@MichaelNielsenDK Obviously this is being fixed ASAP.
Just to be difficult - running the SQL works fine, I can see the folders in the media table, all with mediaPath = null. I donât though have a rendered tree in the backoffice. Folders show fine in the main pane, just nothing in the treeâŚ
Site is 7.8.2 freshly updated to 7.15
EDIT - user error. Ignore me.
Understood. Itâs stable. After Lee said it âhalf worksâ he fixed it, the script has been updated and I mentioned a few times that you should use it if you need to get up and running on 7.15.0 for now.
For future readers:
Workaround if you are already on 7.15.0 and need to fix your media tree right now
The complete SQL script that works great is in this comment, it has been updated after some tests came in and it is now complete: https://github.com/umbraco/Umbraco-CMS/issues/5848#issuecomment-510801892
@nul800sebastiaan Any news on the 7.15.1 release? Donât want to hassle, but itâs been over two weeks now and this is a show-stopper bug in the only release that contains an important security fix. If itâs just changing one query to a
LeftJointhen I would have expected a release much sooner. Are there other issues or some reason for the delay? Normally critical patches are release quickly. Or is there something political at work, with v8 taking all the priority?Using the workaround in the SQL script is the correct thing to do for now until we have a 7.15.1 release ready soon.
Note that for security fixes we also listed workarounds for all older versions that can be used.
We ran the patch SQL (with the additional notes from Lee) and that fixed the issue for us on Umbraco Cloud.
Thanks @nul800sebastiaan and @YodasMyDad
Any idea when this will make it into 7.15.1 and when it will be released? Currently have a live site that no one can add new content on because cannot pick images for the content.
Hi @nul800sebastiaan It wasnât clear how stable that script was given it says, âthis is mostly untestedâ and someone had commented âit half worksâ. You can understand, even with backups, that it can be worrying running an SQL script like this (and if a client is actively populating a site, then restoring the DB from backup a week later if a problem arises isnât really viable as they will lose all content added since that point).
@nul800sebastiaan @Shazwazza Whats the outlook for making a patch for this issue alone? Or at least close 7.15.1 as is? Our clients are upset. And the Security Advisory July 9th 2019 makes it somewhat official that weâve done the correct thing upgrading.
We upgraded to v7.15.0 in part because of the security advisory issued by Umbraco on 9th July:
https://umbraco.com/blog/security-advisory-july-9th-2019/
Being able to select media in folders is critical functionality for editors.
I understand the focus in now on v8, but this isnât a new feature request, this is a request to fix existing functionality that was broken in the last release.
Is there an expected release date for this fix so I can relay this to our clients?