×

Warning!

JUser: :_load: Unable to load user with ID: 20445

Album Manager thumbnail images not showing up

djule5
djule5
Offline
1
Hi,

I'm currently migrating a Joomla 1.5 website to 2.5. For some reason, the Album Manager images won't show the albums thumbnails on the admin page on my 2.5 instance (see screenshot).

I have compared the image src URLs between the two versions.
2.5: /administrator/cache/muscol/muscol_cache_40_8daa8c4e90_1375026619_abcde.jpg
1.5: /components/com_muscol/helpers/image.php?file=/images/albums/1375026619_abcde.jpg&width=40

On the 1.5 one, it works fine - the image exists in the /images/albums folder. On the 2.5, it doesn't - no files in the /administrator/cache folder, not even the muscol folder.

Why is this happening and how can we fix it?

Thank you.

Accepted Answer

Friday, October 04 2013, 12:25 PM - #Permalink
0
yeah I understand what you mean. the URL is "correct" but it is resolving it incorrectly because it takes /administrator as the "root" when it should not...

since I can't access the site... how do you feel about modifying a PHP file?
here is what you would need to try:
open /components/com_muscol/helpers/helpers.php

at around line 306 you will find a function called "getThumbnailSrc". can you replace the whole function for this one? :

function getThumbnailSrc($file, $width, $height = ""){

$params = &JComponentHelper::getParams( 'com_muscol' );
$mainframe =& JFactory::getApplication();

$system = false ;
$cache = $params->get('cache', 1) ;

if($system)
return 'index.php?option=com_muscol&task=thumbnail&type=album&file=' . $file .'&width=' . $width .'&height=' . $height ;
elseif($cache && $file){
require_once(JPATH_SITE.DS.'components'.DS.'com_muscol'.DS.'helpers'.DS.'graphics.php');
if($mainframe->isSite()) return MusColGraphics::renderThumb ($file , $width , $height ) ;
else return "/" . MusColGraphics::renderThumb ($file , $width , $height ) ;
}
else
return 'components/com_muscol/helpers/image.php?file=' .JPATH_SITE.DS.'images'.DS.'albums'.DS. $file .'&width=' . $width .'&height=' . $height ;

}
The reply is currently minimized Show
Responses (7)
  • Accepted Answer

    Thursday, October 03 2013, 04:56 PM - #Permalink
    0
    I asume the images in frontend are showing up, is that correct?

    in that case, the problem must be only a relative path layout
    it should be
    cache/muscol/muscol_cache_40_8daa8c4e90_1375026619_abcde.jpg

    and not
    administrator/cache/muscol/muscol_cache_40_8daa8c4e90_1375026619_abcde.jpg

    the strange thing is I can't reproduce this issue on my end.. what version of J 2.5 are you using? can you maybe give me temporary access to take a look at this? support@ joomlathat.com
    The reply is currently minimized Show
  • Accepted Answer

    djule5
    djule5
    Offline
    Thursday, October 03 2013, 05:20 PM - #Permalink
    0
    That's correct, images show up on frontend (and when editing an album).

    Also, I was mistaken. The actual image src attribute is indeed "cache/muscol/muscol_cache_40_8daa8c4e90_1375026619_abcde.jpg" as you mention, but it still won't show the image. The admin page URL being "/administrator/index.php?option=com_muscol", it then tries to resolve "administrator/cache/muscol/muscol_cache_40_8daa8c4e90_1375026619_abcde.jpg" which doesn't exist.

    When editing the album, the image src attribute is "../images/albums/1375026619_abcde.jpg". Shouldn't the other URL start with "../" as well? When I add it in Chrome's Inspector it seems to resolve the image alright.

    I'm on Joomla 2.5.6. I can't really give you an access to the instance because I'm working on it locally on my own machine (not hosted).
    The reply is currently minimized Show
  • Accepted Answer

    djule5
    djule5
    Offline
    Friday, October 04 2013, 01:54 PM - #Permalink
    0
    Ok so I did replace the function with the one you provided. At first it didn't work, but after replacing
    else return "/" . MusColGraphics::renderThumb ($file , $width , $height ) ;

    with
    else return "../" . MusColGraphics::renderThumb ($file , $width , $height ) ;

    it did the trick.

    The reason is that the Joomla instance lives is in a subfolder of the domain (e.g. example.com/joomla).

    Do you think this hack is stable and should keep working with future upgrades of Joomla?
    The reply is currently minimized Show
  • Accepted Answer

    Friday, October 04 2013, 02:24 PM - #Permalink
    0
    oh...! that's the reason then. the "subfolder" I mean. I think you should not be getting the issue in a non-subfolder installation.

    good job in any case, the "../" will definitely do the trick for your case.
    The reply is currently minimized Show
  • Accepted Answer

    djule5
    djule5
    Offline
    Friday, October 04 2013, 06:08 PM - #Permalink
    0
    Thank you for the support.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 07 2016, 10:58 AM - #Permalink
    0
    Hi Germinal,

    We seem to have the same issue with the cached files. Can you tell us in which file we should change this :)

    EDIT: sorry its stated above! Ill try to change.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 07 2016, 11:04 AM - #Permalink
    0
    Unfortunate I am not able to fix it :(. Could you help me out how to change it :)
    • Germinal Camps
      more than a month ago
      can you send me a link to the page?
    • more than a month ago
      I dont know what I did but it seems to work now :)
    The reply is currently minimized Show
Your Reply