Feature NPM Resource Changed PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
9 Feb 2025

Summary of Changes

The changes allows thumbnail for any file type: video, pdf, audio etc.

Testing Instructions

Apply path, run npm install.
Edit

if (!$isDir && MediaHelper::isImage($obj->name)) {

And add following else condition (optionaly change the image path):

else {
  if (!$isDir){
    $obj->thumb_path = Uri::root(true) . '/images/headers/raindrops.jpg';
  } else {  
    $obj->thumb_path = Uri::root(true) . '/images/headers/maple.jpg';
  }
}

Go to media manager and upload some video, or audio or any other file.
Thn check the thumbnail.

Actual result BEFORE applying this Pull Request

Non image files has a icon

Expected result AFTER applying this Pull Request

Non image files has a 'raindrops.jpg' image

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org: joomla/Manual#420
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 9 Feb 2025
avatar Fedik Fedik - change - 9 Feb 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Feb 2025
Category Administration com_media NPM Change Repository
avatar Fedik Fedik - change - 9 Feb 2025
The description was changed
avatar Fedik Fedik - edited - 9 Feb 2025
avatar brianteeman
brianteeman - comment - 10 Feb 2025

Maybe I am missing something but I am missing the usecase for this and how it can be used by a siteowner without core hacks

avatar Fedik
Fedik - comment - 10 Feb 2025

No need core hacks, what you see in the description is for testing only.

The use case:

  • 3rd filesystem plugins could add thumbnail for their files (I curently need it for video thumbnail for personal project)
  • 3rd plugin could add thumbnail to existing files while listening onFetchMediaItems :
public function onFetchMediaItems($event)
{
  $items = $event->getArgument('items');

  foreach ($items as $item) {
    if (in_array($item->extension, ['mp4', 'mp3', 'pdf'])) {
      $item->thumb_path = Uri::root(true) . '/images/headers/raindrops.jpg';  
    }
  }

  $event->setArgument('items', $items);
}
avatar martin-zw martin-zw - test_item - 17 Feb 2025 - Tested successfully
avatar martin-zw
martin-zw - comment - 17 Feb 2025

I have tested this item ✅ successfully on 242a656


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

avatar viocassel viocassel - test_item - 22 Feb 2025 - Tested successfully
avatar viocassel
viocassel - comment - 22 Feb 2025

I have tested this item ✅ successfully on 242a656


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

avatar QuyTon QuyTon - change - 27 Feb 2025
Status Pending Ready to Commit
Labels Added: NPM Resource Changed Feature PR-5.3-dev
avatar QuyTon
QuyTon - comment - 27 Feb 2025

RTC


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

avatar laoneo
laoneo - comment - 28 Feb 2025

Can this somehow be documented?

avatar Fedik
Fedik - comment - 28 Feb 2025

I will write something after it will be merged.

avatar laoneo
laoneo - comment - 28 Feb 2025

Better would be the opposite, so it will no get forgotten.

avatar Fedik
Fedik - comment - 28 Feb 2025

I mean, I can write doc, but then waiting another year for merging, not much fun and motivating.
If it not going to be merge in this release, then I see no reason to spend my time for docs ASAP.

avatar richard67 richard67 - change - 28 Feb 2025
Labels Added: RTC Documentation Required
avatar Fedik Fedik - change - 28 Feb 2025
Labels Added: PR-6.0-dev
avatar richard67
richard67 - comment - 28 Feb 2025

@Fedik Sorry, it seems my suggested javascript code style changes were not sufficient. Now the javascriptcs checker complains about missing line breaks and indentation: https://ci.joomla.org/joomla/joomla-cms/82743/1/20

avatar Fedik
Fedik - comment - 28 Feb 2025

No problem, I also can fix them later, if it fail again.
But thanks for checking ;)

avatar rdeutz rdeutz - change - 28 Feb 2025
Title
[5.3] Media: allow thumbnail for any file type
[6.0] Media: allow thumbnail for any file type
avatar rdeutz rdeutz - edited - 28 Feb 2025
avatar joomla-cms-bot joomla-cms-bot - change - 28 Feb 2025
Category Administration com_media NPM Change Repository Administration com_associations com_banners com_categories com_checkin com_config com_contact com_content com_contenthistory com_cpanel com_fields com_installer com_joomlaupdate com_media NPM Change com_menus com_modules com_postinstall com_templates com_users
avatar softforge
softforge - comment - 28 Feb 2025

Hi @Fedik I am happy to merge this once we have the documentation. You will not need to wait, if you fix the conflicts then ping me I am getting regular tests on a Friday and it can be tested and merged

avatar Fedik
Fedik - comment - 28 Feb 2025

The conflicts should go away after next upmerge 😉

8ff2a7c 1 Mar 2025 avatar Fedik cs
avatar Fedik Fedik - change - 1 Mar 2025
Labels Removed: PR-5.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 1 Mar 2025
Category Administration com_media NPM Change com_associations com_banners com_categories com_checkin com_config com_contact com_content com_contenthistory com_cpanel com_fields com_installer com_joomlaupdate com_menus com_modules com_postinstall com_templates com_users Administration com_media NPM Change Repository
avatar Fedik
Fedik - comment - 1 Mar 2025

Okay, had to redo "rebase" localy, because automatic one went wrong

avatar Fedik Fedik - change - 1 Mar 2025
The description was changed
avatar Fedik Fedik - edited - 1 Mar 2025
avatar softforge softforge - change - 7 Mar 2025
Labels Removed: Documentation Required
9f14185 10 Mar 2025 avatar Fedik tst
4712b5e 10 Mar 2025 avatar Fedik tst
avatar QuyTon QuyTon - change - 11 Mar 2025
Status Ready to Commit Pending
avatar softforge softforge - change - 11 Mar 2025
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-03-11 12:11:38
Closed_By softforge
Labels Removed: RTC
avatar softforge softforge - close - 11 Mar 2025
avatar softforge softforge - merge - 11 Mar 2025

Add a Comment

Login with GitHub to post a comment