J3 Issue ?
avatar garstud
garstud
20 Mar 2018

Steps to reproduce the issue

  • verify that you Media Manager accept PDF files (it is ok by default)
  • Create an article Media Custom Field

Use it in an article :

  • click on the Media Custom Field
  • upload a PDF file
  • try to select the uploaded PDF file

Expected result

You can select the PDF file uploaded through the Media Custom Field because it is accepted and store by the Media Manager.

Actual result

You succeed to upload the PDF file through the Media Custom Field (you can verify it by the Media Manager)
But you can not see it nor select it through the Media Custom Field.

System information (as much as possible)

dbversion: 5.7.14
dbcollation: utf8_general_ci
dbconnectioncollation: utf8mb4_general_ci
phpversion: 7.0.10
server: Apache/2.4.23 (Win64) PHP/7.0.10
sapi_name: apache2handler
version: Joomla! 3.8.5 Stable [ Amani ] 6-February-2018 15:00 GMT
platform: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36

avatar garstud garstud - open - 20 Mar 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Mar 2018
avatar Quy
Quy - comment - 20 Mar 2018

Duplicate #10871.

Short answer: Media custom field is for images only.

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Mar 2018
Status New Duplicate Report
Closed_Date 0000-00-00 00:00:00 2018-03-21 06:12:16
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2018
Status Duplicate Report Closed
Closed_Date 2018-03-21 06:12:16 2018-03-21 06:12:17
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 21 Mar 2018
avatar ghost
ghost - comment - 21 Mar 2018

closed as duplicate Report.


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

avatar joomla-cms-bot
joomla-cms-bot - comment - 21 Mar 2018

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/19954

avatar Robdebert
Robdebert - comment - 13 Sep 2018

Guys, there are so many Issues regarding the possibiliy to select other files types in a modal-window like the media-type allows it, but all the ones that i came accros and read are closed because "duplicate of xy" or "use another field-type".

As you can see in this conversation #10871 there IS a need to use a modal-window for not only uploading files but also select them after upload. The file-type-field is not a proper solution for this (because you have to upload a file again which might already be on the server - please don't suggest to use 2 fields: file and filelist :-D ).

So: Where is the issue that we can talk about this feature? Please add a link to all the closed ones.

avatar ghost
ghost - comment - 13 Sep 2018

@Robdebert thanks for your Comment, but Comments on closed Issues didn't get much Notice. So i suggest to open an new one.

Please add a link to all the closed ones.

i guess you know but to be sure: open https://github.com/joomla/joomla-cms/issues?q=is%3Aissue+is%3Aclosed

avatar Robdebert
Robdebert - comment - 27 Sep 2018

Thanks for your answer.

But can we not just re-open this issue? Because there is already a lot of information here. Opening a new one will only create the next issue to the same topic, that already exists (in this and other issues, that where created).

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Sep 2018
Status Closed New
Closed_Date 2018-03-21 06:12:17
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - change - 27 Sep 2018
Closed_Date 0000-00-00 00:00:00
avatar joomla-cms-bot joomla-cms-bot - reopen - 27 Sep 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 27 Sep 2018

Set to "open" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/19954

avatar ghost
ghost - comment - 27 Sep 2018

Reopened as stated above.


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Sep 2018
Status New Discussion
avatar Quy
Quy - comment - 4 Oct 2018

PR #19967 is closed, but addresses this issue.

avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 30 Oct 2018
avatar martyharty
martyharty - comment - 26 Mar 2019

In Joomla 4 uploading pdf is enabled by default, but not rendered on the frontend.

Changing plugins/fields/media/tmpl/media.php from:

...
if (!$path)
{
continue;
}
$buffer .= sprintf('<img src="%s"%s>',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
...

To:

...
if (!$path)
{
continue;
}
if(substr($path, -4) == '.pdf')
{
$parts = explode('/', $path);
$buffer = ''. $parts[1] .'';
} else {
$buffer .= sprintf('<img src="%s"%s>',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
}
...

Did the trick for me: https://gridx.joomla.com/

Both are Media fields and Download renders without preview (No) in frontend editor.

The same is done in Joomla 3 without automatic display, custom fields and rawvalue.

In my opinion (pre)setting the images/files/docs folders should work in most cases.

Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19954.
avatar martyharty
martyharty - comment - 26 Mar 2019

With href:

if (!$path)
	{
		continue;
	}
	if(substr($path, -4) == '.pdf')
	{
		$parts = explode('/', $path);
		$buffer = '<‍a href="'. $path .'" target="_blank" rel="noopener">'. $parts[1] .'';
	} else {	
	$buffer .= sprintf('',
		htmlentities($path, ENT_COMPAT, 'UTF-8', true),
		$class
		);	
	}

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19954.
avatar martyharty
martyharty - comment - 26 Mar 2019

With href:

if (!$path)
	{
		continue;
	}
	if(substr($path, -4) == '.pdf')
	{
		$parts = explode('/', $path);
		$buffer = '<‍a href="'. $path .'" target="_blank" rel="noopener">'. $parts[1] .'';
	} else {	
	$buffer .= sprintf('',
		htmlentities($path, ENT_COMPAT, 'UTF-8', true),
		$class
		);	
	}

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19954.
avatar martyharty
martyharty - comment - 28 Mar 2019

Attached improved code to always get the end-path from different files folders. https://gridx.joomla.com/
Changing plugins/fields/media/tmpl/media.php to:

foreach ($value as $path)
{
	if (!$path)
	{
		continue;
	}
	if(substr($path, -4) == '.pdf')
	{
		$file = explode('/', $path);
		$buffer = '<a href="'. $path .'" target="_blank" rel="noopener">'. end($file) .'</a>';
	} else {
	$buffer .= sprintf('<img src="%s"%s>',
		htmlentities($path, ENT_COMPAT, 'UTF-8', true),
		$class
		);
	}
}
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Status Discussion Information Required
avatar hardik-codes
hardik-codes - comment - 28 Mar 2019

@franz-wohlkoenig can I do this if @martyharty doesn't have any problem

avatar ghost
ghost - comment - 28 Mar 2019
avatar martyharty
martyharty - comment - 28 Mar 2019

Please go ahead. I noticed setting a files path on Media Field is not accessible from frontend. Check with user(name) and pass(word) on https://gridx.joomla.com/ (default images path is no problem).

Regarding Joomla 4 it seems the System - Privacy Consent plugin is not redirecting user on frontend login.
Also saving Content Fields on backend: An error has occurred. 0 Class 'FieldsHelper' not found.

One more thing. The Joomla 4 alpha on https://launch.joomla.org/ is set to daily renewal which means the site is lost in one day... monthly as default - like cloudaccess - works better I guess.

Thanks

avatar ghost
ghost - comment - 28 Mar 2019

@hardik-codes new Features goes only in J4

@martyharty please report the Request at CloudAccess.

avatar hardik-codes
hardik-codes - comment - 28 Mar 2019

@franz-wohlkoenig so I have to make a PR for 4.0-dev ?

avatar ghost
ghost - comment - 28 Mar 2019

yes, there are only Bugfixes in J3.

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Apr 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-04-02 09:38:40
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 2 Apr 2019
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 2 Apr 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 2 Apr 2019

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/19954

avatar ghost
ghost - comment - 2 Apr 2019

closed as having Pull Request #24409

avatar Quy Quy - reopen - 8 Oct 2019
avatar Quy Quy - change - 8 Oct 2019
Status Closed Pending
Closed_Date 2019-04-02 09:38:40
Closed_By joomla-cms-bot
avatar Quy
Quy - comment - 30 Jun 2021

Fixed per #34634 for J4.

avatar Quy Quy - change - 30 Jun 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-06-30 17:49:08
Closed_By Quy
avatar Quy Quy - close - 30 Jun 2021

Add a Comment

Login with GitHub to post a comment