?
avatar webchun
webchun
20 Jun 2016

Steps to reproduce the issue

  • I'm testing the upcoming custom fields feature, to attach a pdf file in an article, so my user can download it
  • So, I created a 'media' field
  • Then when I added a new article I uploaded a pdf file via the 'media' field I created before

Expected result

  • The pdf file is succesfully uploaded and listed in the modal so I can choose it to embed the link in my article

Actual result

  • The pdf file is succesfully uploaded but not listed/showed in the modal

screenshot

System information (as much as possible)

Joomla 3.7

Additional comments

I initially opened this issue in the custom field repo and @laoneo suggested me to post this on CMS repo as this issue more related to media form field (which is missing this configuration option) rather than custom field

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar webchun webchun - open - 20 Jun 2016
avatar brianteeman
brianteeman - comment - 20 Jun 2016

The media field type is designed for images (see https://docs.joomla.org/Media_form_field_type)

The one for files is the file field type ( see https://docs.joomla.org/File_form_field_type)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10871.

avatar brianteeman
brianteeman - comment - 20 Jun 2016

Sorry to be passing you from pillar to post but its not a problem with the core field type. the problem is that custom fields is using one field type when there should be two


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10871.

avatar brianteeman brianteeman - change - 20 Jun 2016
Labels Added: ?
avatar laoneo
laoneo - comment - 20 Jun 2016

Would it be an option to allow more file extensions than images for the new media manager?

avatar brianteeman
brianteeman - comment - 20 Jun 2016

Media Manager already does - You can see right now that Media Manager will
display pdf files.
What you are seeing in the Modal in this example is not the full media
manager but a subset to display images - which is the file type supported
by the media field.
(On my phone right now so cant double check but pretty sure that if you use
the core FILES field then the modal selector will show the pdf as well)

On 20 June 2016 at 10:52, Allon Moritz notifications@github.com wrote:

Would it be an option to allow more file extensions than images for the
new media manager?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#10871 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABPH8Z47wdGwa1fESXUaPYGPCJSLJsVLks5qNmL6gaJpZM4I5gFp
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar brianteeman
brianteeman - comment - 20 Jun 2016

The problem is that you only have a Media field type in Custom Fields - if you look at the tooltips for that field in Custom Fields you can see it is for images only.

You just need to have another field type in Custom Fields for files

avatar laoneo
laoneo - comment - 20 Jun 2016

The file field type, allows to select only an existing file from the filesystem. What @webchun wants, is the full media manager functionality (upload) for none image files.

I'v just tested it and uploaded a PDF trough the media manager. It is not displayed in the media manager. If this is possible already, then there are undocumented attributes for the media manager XML definition here https://docs.joomla.org/Media_form_field_type which should be supported by custom fields, which would then make this issue obsolete.

avatar brianteeman
brianteeman - comment - 20 Jun 2016

As you can see below media manager works fine for pdf

Please read what I have already stated

mediamanager

avatar brianteeman
brianteeman - comment - 20 Jun 2016

The file field type, allows to select only an existing file from the filesystem.

That is not true. The documentation clearly says that AND if you think the documentation is wrong then you just need to see that com_joomlaupdate uses a field with type="file"

avatar laoneo
laoneo - comment - 20 Jun 2016

That's the media manager from Articles which opens with the default view. The one which is opened trough the form field adds a view=imagesList parameter to the url of the iframe which shows only the images. If this would be a configurable option, then we can add a parameter in custom fields. Before this is done, it's not possible.

That is not true. The documentation clearly says that AND if you think the documentation is wrong then you just need to see that com_joomlaupdate uses a field with type="file"

Don't know where to find it.

avatar brianteeman
brianteeman - comment - 20 Jun 2016

That's exactly why I said to read what I have already written.

avatar mbabker
mbabker - comment - 20 Jun 2016

You'd have to rewrite the media field and media manager.

The media field uses the images view of the admin com_media component and if you follow its traces around long enough you'll find that the inner iframe's contents are populated by a method that explicitly filters to display only images.

avatar dgt41
dgt41 - comment - 20 Jun 2016

@brianteeman is correct here the modal doesn't have a handler for pdf's and videos although these appear correctly in the component media. Nothing to do with custom fields

avatar brianteeman
brianteeman - comment - 20 Jun 2016

The problem is that custom fields does NOT have a field type of files
It only has a field type of media

Problem is resolved by adding the files field type

Sorry if I wasnt clear enough 3 hours ago

avatar dgt41
dgt41 - comment - 20 Jun 2016

@mbabker I guess we can introduce a param for file types (in case not defined only images will be displayed B/C) and mix in the new views in the new media component. In such case custom fields will need minor adjustment

avatar mbabker
mbabker - comment - 20 Jun 2016

Problem is resolved by adding the files field type

It's actually the "filelist" field type. And that's one workaround, but that field type is a select list only. If the intent is a full UI similar to the media field, then as I said com_media and the media field itself need updates.

avatar brianteeman
brianteeman - comment - 20 Jun 2016

Why is it not the file field type https://docs.joomla.org/File_form_field_type

avatar laoneo
laoneo - comment - 20 Jun 2016

Why is it not the file field type https://docs.joomla.org/File_form_field_type

As I said, this allows to select only a file form the filesystem of an existing list, nothing to upload. Create a file custom field and you will see what I mean.

avatar brianteeman
brianteeman - comment - 20 Jun 2016

No. It lets you upload a file

avatar laoneo
laoneo - comment - 20 Jun 2016

Just for the record, the line we are talking about can be found here https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/form/field/media.php#L174 which has the view parameter imageList hardcoded.

avatar laoneo
laoneo - comment - 20 Jun 2016

No. It lets you upload a file

True, sorry was on that field https://docs.joomla.org/Filelist_form_field_type.

avatar brianteeman
brianteeman - comment - 20 Jun 2016

I did give you the link three hours ago #10871 (comment)

avatar mbabker
mbabker - comment - 20 Jun 2016

Are we all on the same page finally?

avatar laoneo
laoneo - comment - 20 Jun 2016

I guess we can introduce a param for file types (in case not defined only images will be displayed B/C) and mix in the new views in the new media component. In such case custom fields will need minor adjustment.

Would fix the problem. We would be able then to use the media manager to upload and select none image files.

avatar brianteeman brianteeman - change - 20 Jun 2016
Category Fields
avatar webchun
webchun - comment - 20 Jun 2016

As suggested by @brianteeman I think adding a new custom field type (file) is sufficient for the basic need to upload + include a file / attachment in an article. I was actually trying to find the 'file' type of custom field before trying the media field but I can not find it, so I tried media.

avatar laoneo
laoneo - comment - 21 Jun 2016

The file field does only show a file upload box. IMO the media manager is the way to go.

avatar webchun
webchun - comment - 21 Jun 2016

The file field does only show a file upload box. IMO the media manager is the way to go.

Yes, this would be the ideal option, because it will also let us to pick (existing) files easily, but I'm not sure how complicated is it to implement it.

But for the basic uploading file's need, I think 'file' type field is sufficient

avatar laoneo
laoneo - comment - 21 Jun 2016

I'm sure for @dgt41 it is a quick fix ?

avatar dgt41
dgt41 - comment - 21 Jun 2016

@laoneo you mean to get a js uploader for field file? It shouldn't be hard to do but honestly I am against it as all these scripts might fail on several browsers for any reason so the native browser button is a better solution. We can style that better if we want, or have a template override for it (it's using JLayout now I think) and integrate any uploader. But in short if you propose to override the native browser functionality for a js uploader, in this case, I am against that. ?

avatar laoneo
laoneo - comment - 21 Jun 2016

I was referring to your solution here #10871 (comment). No need for a JS uploader functionality. That would help to solve this issue, as we can then allow more file types than only images in the media form field.

avatar brianteeman brianteeman - change - 3 Aug 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-08-03 16:50:51
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 3 Aug 2016

That was an interesting conversation but at the end of the day it is just simply using the wrong field type. Closed


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10871.

avatar brianteeman brianteeman - close - 3 Aug 2016
avatar laoneo
laoneo - comment - 3 Aug 2016

No, it's not. There is a parameter missing in the media form field, which is adressed by this issue. Please reopen this issue.

avatar dgt41
dgt41 - comment - 3 Aug 2016

@laoneo so will it be a comma separated file extensions the params? It's a simple fix if we decide what the params that the media will be allowed to accept

avatar brianteeman brianteeman - change - 3 Aug 2016
Status Closed New
Closed_Date 2016-08-03 16:50:57
Closed_By brianteeman
avatar brianteeman brianteeman - reopen - 3 Aug 2016
avatar brianteeman
brianteeman - comment - 3 Aug 2016

Reopened as requested

avatar laoneo
laoneo - comment - 3 Aug 2016

I can't really remember, but I think the view parameter which is hardcoded here https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/form/field/media.php#L174 needs to be configurable. I think I was mention it here #10871 (comment).

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Jan 2017

@laoneo there is no "file-field", in "media-field" pdf can be uploaded but isn't shown.

avatar laoneo
laoneo - comment - 30 Jan 2017

That's what we try to solve here. But with the new media manager it is planed to support multiple file types better in the future. So I guess we can close this one for now.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Jan 2017

@laoneo true, thanks for Info.

avatar com3rddesign
com3rddesign - comment - 24 Mar 2017

Hi All.
Sorry I am not an advanced user of Joomla 3.7 and I understand it is stable enough to be used on commercial projects.

However attaching Files is of massive importance. I understand the fields at the moment can only have media files attached, ie images. However, I would like to add files. I understand from @brianteeman comment that there is a file type found at this link:
https://docs.joomla.org/File_form_field_type

But how do we get to add this to the list of field items ?
What file to add it to ?

avatar Bakual
Bakual - comment - 24 Mar 2017

First, 3.7.0 is not stable yet and should not be used in production. It's beta.
Attaching a file needs much more code than just a daabase entry. You need to upload the file and store it somewhere, doing some additional security checks during that process.
Such a field doesn't exist in core.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Apr 2017

@laoneo should this Issue closed caus no file-field-Plugin is in 3.7?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar joomla-cms-bot joomla-cms-bot - change - 6 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 6 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Apr 2017
Status New Information Required
avatar laoneo
laoneo - comment - 6 Apr 2017

yes

avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Apr 2017
The description was changed
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2017-04-06 15:57:55
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 6 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 6 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 6 Apr 2017
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 6 Apr 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 6 Apr 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Apr 2017

closed as Issue resolved, thanks for Info @laoneo


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Apr 2017

closed as Issue resolved, thanks for Info @laoneo


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar brianpeat
brianpeat - comment - 28 Jun 2017

This is a bummer, but I discovered that if you're running JCE, it bypasses this issue as you get THEIR media manager replacement which DOES support PDFs.

Still, it would be nice to get a real file/attachment field eventually. It could be set to allow certain file types (like media manager does) and an option to use a root folder that the user can't browse OUT of (for security purposes). Maybe I'll look into having someone write such a plugin, but for now, using JCE totally gets around the limitation. Just putting that out there in case someone stumbles on this thread.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Jun 2017

@brianteeman can you please open a new Issue or write on an open Issue? Less People will read closed issues, thanks.

avatar brianteeman
brianteeman - comment - 28 Jun 2017

Wrong brian

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Jun 2017

äh, sorry @brianteeman, meant @brianpeat :-)

avatar brianpeat
brianpeat - comment - 28 Jun 2017

Actually I want my comment left on this ticket because I had the issue and when I googled it, this issue came up. If someone else hits the same issue, at least now if they find this, they'll have a work around.

avatar GCLW
GCLW - comment - 30 Jun 2017

Really should be able to upload/select PDF files and Video files when using a custom field. When you directly access the Media Manager via the Administrator area, you can upload PDF and Video files. But there is no capability in Joomla, even now with custom fields to be able to upload/select a PDF or Video file outside the media manager. JCE is out of the question for me.

I don't even need it embedded in the article like an image, I just need the field so I can then manipulate the template file on how to display the field within the article.

I have people that are wanting to attach video files to an article when they create them on the front end. And even with the addition of custom fields this is still impossible to do.

If someone knows how to do this using the custom fields please direct me there.

avatar webcoast
webcoast - comment - 22 Aug 2017

I am using Joomla 3.7.5, and creating custom fields to be filled in when creating a new user. I would like to upload a PDF, however the field type that is being referred to in this thread 'file' is not available when creating the new field, it does not appear in the dropdown list of available field types. How would I go about adding this 'field' field type to the dropdown list?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Aug 2017

Please ask help on the forums. This repository concerns Joomla coding.

avatar flux3
flux3 - comment - 1 Oct 2017

So was the end result of this that you can't upload PDFs using the Media field or any of the current OOB Extra fields? I mean yes you can "upload" a pdf but you cannot select it as it cannot be seen in the modal once uploaded. As far as I can see the only way to link to a non media file is to upload it using Media Manager and then type the relative url into a 'URL' field or 'Text' field. I do hope this functionality or the addition of the 'File' Field is considered in future updates of the Extra Fields feature which is already amazing.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar GCLW
GCLW - comment - 3 Oct 2017

You can upload PDF files using the Media field in the Modal. It is just after the upload, you get the successful message, but the PDF does not appear in the window for you to select. And since the input field that displays the path of the selected file is read only, you can not even manually type in the path to the PDF file.

I think people are requesting the ability to upload and link a PDF file on the fly when creating an article. Not having to before hand use the full blown media manager (which is impossible to do on the front end) to upload the PDF files, and then write down the path to be used when actually creating or editing the article. Even using the "filelist" field type would offer a quicker way to select the file name. You run into issues where that directory becomes filled with files, and or files are being uploaded to other directories.

We are looking for the modal to work the same way for PDF files as it does for images.

avatar Stereonomy
Stereonomy - comment - 14 Dec 2017

Hi there,
I face this problem and I test something to make possible to select a pdf file with the media field used in a repeatable subform in a component.
I just added a line in administrator/com_media/models/list.php
line 160 case 'pdf': (see screenshot)
It works fine even if it is not ideal to hack a Joomla core component, but couldn't the solution be so simple ?
screen shot 2017-12-14 at 15 53 39
Regards


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar Stereonomy
Stereonomy - comment - 14 Dec 2017

Hi there,
I face this problem and I test something to make possible to select a pdf file with the media field used in a repeatable subform in a component.
I just added a line in administrator/com_media/models/list.php
line 160 case 'pdf': (see screenshot)
It works fine even if it is not ideal to hack a Joomla core component, but couldn't the solution be so simple ?
screen shot 2017-12-14 at 15 53 39
Regards


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Dec 2017

@Stereonomy can you please open a new Issue as Comments on closed Issues didn't get much Notice, thanks.

avatar ggppdk
ggppdk - comment - 28 Mar 2018

I have made this PR #19967

if you agree with it , the i will restore default behaviour of the view to be only images without the docs and videos

and then according to your suggestions, we can add the choice of showing also videos, docs

avatar Toolmaster
Toolmaster - comment - 17 May 2018

I don't see a content field of the type "file" in the Joomla core. Was this dropped?

In general I don't agree with the media content field type can't be used for PDF's as well. My resolution is simple - if the media manager can be used for PDF's (as it can), thus considering PDF's as "media". Then why can't a media type content field be used for PDF's?

@Stereonomy Your solution does seem to work as you can only choose the file, but after saving the article the choice is lost (only path remains)!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar Toolmaster
Toolmaster - comment - 17 May 2018

@Stereonomy My bad it now works. Think I had a firewall problem.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.

avatar uglyeoin
uglyeoin - comment - 23 Aug 2019

Can we rename it images if it doesn't accept media?

avatar mbabker
mbabker - comment - 23 Aug 2019

Can we rename it images if it doesn't accept media?

It can support media. The entire problem is architecturally the media field is hardcoupled to a view in com_media that explicitly filters every non-image media type out from the display. And nobody has bothered to sit down and come up with a solution that allows someone to use the media field to show all media types, or a custom filter if they're in a context where a custom list of types should be applied. Or, ya know, just rename the field to mask the fact that there isn't anybody skilled enough in PHP working on core to make the media field an actual media field and not a glorified image list.

avatar sx007
sx007 - comment - 21 May 2020

Hi there,
I face this problem and I test something to make possible to select a pdf file with the media field used in a repeatable subform in a component.
I just added a line in administrator/com_media/models/list.php
line 160 case 'pdf': (see screenshot)
It works fine even if it is not ideal to hack a Joomla core component, but couldn't the solution be so simple ?
screen shot 2017-12-14 at 15 53 39
Regards

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.
Add to 200 line:
case 'pdf':
$tmp->width_60 = 32;
$tmp->height_60 = 32;
$tmp->icon_32 = 'images/mime-icon-32/' . $ext . '.png';
$tmp->icon_16 = 'images/mime-icon-16/' . $ext . '.png';
$images[] = $tmp;
break;
https://imgur.com/oQvGvqD

And edit /administrator/templates/isis/html/com_media/imageslist/default_image.php to 23 line
https://imgur.com/cDM6cKq

And finaly in module show icon
https://imgur.com/KZONw01

avatar uglyeoin
uglyeoin - comment - 21 May 2020

@sx007 does this also show the file at the other end? or does it do something weird like put it in an <img src> tag?

Add a Comment

Login with GitHub to post a comment