U4-4609 - v7.1 Media Picker datatype only allows selection of images not PDFs

Created by Will Price 04 Apr 2014, 07:35:20 Updated by Andrei 03 Mar 2017, 16:21:39

Is duplicated by: U4-4740

Relates to: U4-5303

When using the Media Picker datatype for a Document Type property, the picker only shows images in the Media folders, not other items such as PDFs. This occurs for both the Legacy and new Media Picker.

4 Attachments

Comments

Jeavon Leopold 04 Apr 2014, 08:54:50

I'm not able to recreate this with Umbraco v7.1, I have tried with a PDF in the root media and within folders containing images. Could you post some screenshots?


Matt Brailsford 04 Apr 2014, 12:54:34

Working from a fresh install of v7.1 I have come across the same. If you launch a media picker and your file is anything other than an image, it doesn't get displayed. Looking into the source, it seems because the entity in /umbraco/views/common/dialogs/mediapicker.html has it's images-only property set to true.

It looks like this is meant to be a configurable property (the media picker looks for a value from config) but it's not fully wired up so you can't set a value in prevalue, and it doesn't get applied to the html either so it is basically currently hard coded to be images only.


Blake Clerke 05 Apr 2014, 22:41:45

I can replicate this issue with 7.1 as well. I actually first ran into this problem with trying to pick a PDF to link to from the RTE. I can see images but not PDFs so maybe this is the same issue at the core? I took a screencast - http://screencast.com/t/rLViKaLDEoyC


Josh Olson 07 Apr 2014, 09:57:29

I have just run into this same issue also using 7.1. I edited ''\Umbraco\Views\common\dialogs\mediapicker.html'' to change '''images-only="true"''' to '''images-only="false"''' as Will suggested as a temporary fix.


Stewart Ellis 22 Apr 2014, 14:28:20

This is marked as fixed, but I don't believe it is. I'm running 7.1.1 (Umbraco version 7.1.1 assembly: 1.0.5211.22376 to be specific).

Looking at the mediapicker.html view file I see:

ng-model="images" images-only="{{onlyImages}}"

I changed this param to "false" on line 5085 of \umbraco\Js\umbraco.services.js and it seems to work now. Will this continue to default to "true" in future builds?


Sebastiaan Janssen 22 Apr 2014, 17:30:02

Sorry, re-opened this too quickly. Try refreshing your cache (thoroughly!). It is indeed set to {{onlyImages}} which for the moment will render just the images-only attribute with no value, which will be picked up as the value being false. I do see PDFs and when I set images-only="true" in mediapicker.html I do not see PDFs.


Stephen Dougherty 14 Jul 2014, 23:20:03

Tried this in multiple browsers in 7.1.4 refreshed my cache thoroughly as recommended and the images-only attribute has the value "true". In turn no PDF's are displayed when inserting media.


Sebastiaan Janssen 15 Jul 2014, 10:21:03

@Stephen.Dougherty1367715866382 Is this an upgrade? Make sure to change the version (just make it 1 higher) in ClientDependency.config, recycle your app pool, clear your cache.


Stephen Dougherty 16 Jul 2014, 13:08:43

Yes it is an upgrade. I will repeat these steps again and report back.


Damian Green 01 Aug 2014, 08:46:22

I am also still seeing this on 7.1.4 and my html control has the onlyImages value:

umb-photo-folder min-height="105" min-width="150" max-height="250" ideal-items-per-row="3" on-click="clickHandler" ng-model="images" images-only="{{onlyImages}}" filter-by="searchTerm"

the editor has removed the braces btw - not sure how to make this markup show as code.


Damian Green 01 Aug 2014, 09:29:31

I got it to work by entering an empty value (removing the onlyImages) and then doing a ctrl F5 in the back office. So it looks like there is still an issue. I am on 7.1.4

If i put the onlyImages back in and refresh the cache it stops working again.


Sebastiaan Janssen 01 Aug 2014, 09:44:37

And I still can'r reproduce.. Also inspect the html in your browser the "images-only" attribute should have no value. Try a different browser, it can still be cache, Chrome is very aggressive at caching.


Sebastiaan Janssen 01 Aug 2014, 09:45:03

Inspect like this


Damian Green 01 Aug 2014, 10:00:56

Images only is set to true in the html and i get exactly the same in Firefox.


Damian Green 01 Aug 2014, 10:02:11

Just a thought sebastiaan - i am using the media picker from the Rich Text editor - are you?


Sebastiaan Janssen 01 Aug 2014, 10:47:59

Aha! Now we're getting somewhere. Steps to reproduce are important as ever. :) Yup, can repro in RTE - issue U4-5303 created for this.


Andrei 03 Mar 2017, 16:21:39

@sebastiaan I am having same issue. Here is my SO question http://stackoverflow.com/questions/42565013/umbraco-media-does-not-have-an-approved-file-type. I incremented client dependency and tried everything from the thread. I downloaded clean umbraco .zip archive and put it under IIS and I see same problem, I can only pick images. I think it's still a problem.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Per Ploug

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.1.4

Due in version: 7.1.1

Sprint:

Story Points:

Cycle: