[CONFIRMED] Images not showing up on category/section description

This forum is for reporting bugs in Joomla!. Please don't report problems with extensions in here.
Locked
TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

[CONFIRMED] Images not showing up on category/section description

Post by TracyDoesPHP » Wed Nov 21, 2007 8:12 pm

Description of bug:
The content of my site often has images along with text. I use the backend admin tool to load content, and upload images to the fileserver with the Media Manager. I use the Image button below the WYSIWYG editor to insert into my content a reference to an uploaded image. I use the same method when creating an article as well as in the description field of a section or category.

My section and category links are blog layouts that have Show Description set to yes, and no article or article links pulled in. So all content for the section and category pages are placed in the description field of the section or category. My article links are plain old article layouts.

On the section blog pages and article layout pages, any images I inserted into the text/description properly show up on the front end. But on category blog pages, it does not.

I looked into this and I think I discovered the cause: when using the in-editor Media Manager via the Image link below the WYSIWYG editor to insert an image into an article, category, or section, it inserts it without a leading slash, such as

Code: Select all

<img src="images/content/image2.jpg" border="0" />

However, somewhere in the Joomla code it seems to add a leading slash to that img tag, as when I view the source on an article or section page on the front end, the code is

Code: Select all

<img src="/images/content/image2.jpg" border="0" />

However, for category blog pages, that leading slash is not inserted, and hence the image cannot be found as it looks for the images folder to be relevant to the current URL, which it is not - it is relative to the main domain. Not sure where in the code those leading slashes are added, though.

Interestingly, if you set the category blog link to show description but also put in articles, any images in the category description are missing the leading slash before images/ and therefore cannot be found, but any images in the articles that are displayed there do have the leading slash and do appear, just like if you have one article by itself on an article layout page. So this seems to be done at whatever level pulls in the contents of an article or category, not at the view level.

Joomla version: RC3 with SEF URLs and mod_rewrite turned on

System info: PHP 5.1.6

Steps to replicate:
1. Create a new category
2. Put some text in the category description field, and use the Media Manager via the Image button-initiated's in-editor popup to insert an image into the description field.
3. Save the category, then create a menu link to the category, of type Category Blog Layout. Set Show Description to yes.
4. Check out that category page on your front end. The text from the description field will appear, but not the image (not there at all in Firefox, red x in place of image in IE 6).

Proposed fix(es): See last 2 paragraphs under "Description of bug".
Last edited by tcp on Sat Dec 08, 2007 3:26 am, edited 1 time in total.

User avatar
tcp
Joomla! Ace
Joomla! Ace
Posts: 1548
Joined: Wed Sep 21, 2005 9:25 am
Location: Thailand
Contact:

Re: Images not showing up on category pages - leading slash in img src is missin

Post by tcp » Thu Nov 22, 2007 8:00 am

Have you tried a nightly build?  A lot of work has been done over the past two months to address these problems.

tcp
Your solution for a single-page checkout on any website.
http://moolah-ecommerce.com

TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

Re: Images not showing up on category pages - leading slash in img src is missin

Post by TracyDoesPHP » Mon Nov 26, 2007 2:57 pm

I've downloaded one or two of the nightly builds since RC3 to check out some of the code, but I've never installed them, so I can't say whether this has been fixed since RC3. But I couldn't find a bug report about this error in particular - which is why I posted this in the first place - so I assume this was not a known issue and therefore has not yet been fixed in the nightly builds.

Can anyone confirm this issue?

User avatar
lcdweb
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Thu Jul 19, 2007 3:32 am
Location: Albany, NY
Contact:

Re: Images not showing up on category pages - leading slash in img src is missin

Post by lcdweb » Mon Nov 26, 2007 9:31 pm

I just did a quick install of the latest nightly build, as I was running into the same problem with section descriptions that included an image, and it appears to be fixed.

**** EDIT *****

I take it back. I didn't have SEF turned on when I tested it. It's still broken -- images don't appear in Section/Category descriptions with SEF Turned on. It adds "index.php" to the image reference.
Last edited by lcdweb on Mon Nov 26, 2007 11:19 pm, edited 1 time in total.

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15745
Joined: Thu Aug 18, 2005 10:41 am

Re: Images not showing up on category pages - leading slash in img src is missing

Post by Robin » Tue Nov 27, 2007 11:11 am

Hi all,

could you please check again with build 9442 or later? With SEF/Rewrite enabled I do get to see my images in Section and Category descriptions as supposed to.
Database Version: 5.0.45-community-nt
Database Collation: utf8_general_ci
PHP Version: 5.2.4
Web Server: Apache/2.2.4 (Win32) PHP/5.2.4
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.0 Production/Stable [ Takriban ] 5-October-2007 21:00 GMT
User Agent: Opera/9.24 (Windows NT 5.1; U; en)

User avatar
tcp
Joomla! Ace
Joomla! Ace
Posts: 1548
Joined: Wed Sep 21, 2005 9:25 am
Location: Thailand
Contact:

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by tcp » Tue Nov 27, 2007 12:44 pm

Cannot confirm w/ Rev 9445.
You do not have the required permissions to view the files attached to this post.
Your solution for a single-page checkout on any website.
http://moolah-ecommerce.com

TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by TracyDoesPHP » Thu Nov 29, 2007 12:02 am

I don't know where the revision # comes from, but I downloaded and installed the Nov. 27th nightly build and tested this issue there, and the leading slash is still missing for section/category images that are contained within the Description field for the section or category.

User avatar
lcdweb
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Thu Jul 19, 2007 3:32 am
Location: Albany, NY
Contact:

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by lcdweb » Thu Nov 29, 2007 12:15 am

I think there's something quirky going on with this. I had the same experience (downloaded the 11/27 nightly build, and it didn't appear). Then I just started playing with things. For some weird reason, after I enabled the section image and set it to show on the page (the image connected with the section, NOT in the body of the description), the images that were in the description appeared. I then shut off the section image and the description images remained. I thought it might have just been a caching issue or something, so I didn't post (assuming the latest builds had fixed the problem). But I wonder if there something in the SEF rewrite that's not kicking in unless the section image triggers it first. Pure speculation here...

TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by TracyDoesPHP » Thu Nov 29, 2007 3:18 pm

lcdweb wrote: I think there's something quirky going on with this. I had the same experience (downloaded the 11/27 nightly build, and it didn't appear). Then I just started playing with things. For some weird reason, after I enabled the section image and set it to show on the page (the image connected with the section, NOT in the body of the description), the images that were in the description appeared. I then shut off the section image and the description images remained. I thought it might have just been a caching issue or something, so I didn't post (assuming the latest builds had fixed the problem). But I wonder if there something in the SEF rewrite that's not kicking in unless the section image triggers it first. Pure speculation here...
I tried this with the Nov. 27th nightly build, and it still didn't work. I set up a section with text and an image in the description field, and assigned a menu link for it where I set Description to show and Description Image to hide. The image was in the HTML but without the leading slash in the src so it does not show up. I tried changing the menu link setting of Description Image to show, as well as adding a section image and later removing it, but at no point did the leading slash get put in so that the image would show up properly.

TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by TracyDoesPHP » Fri Dec 07, 2007 4:36 pm

Someone using Joomla 1.0.13 is reporting what might be the same issue: see http://forum.joomla.org/index.php?topic ... msg1105891.

Oh my...is it possible that the img src path to images within a category description has always been incorrect, and this is not just a 1.5 RC3 issue?

Regardless, I am still having this issue with RC3.

TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by TracyDoesPHP » Fri Dec 07, 2007 5:26 pm

Also, this isn't just for category descriptions (as I made it seem in my earlier posts), this issue happens with section descriptions as well, whether you view the section as a section link or a section blog link. The leading slash is not inserted for section descriptions either, leading to your browser trying to find the image relative to the URL you are currently at (which I guess is only relevant when you are using SEF URLs, which I am).

Please note that you may not notice this error if you make a section link at the 1st level of a menu, which may be why some of you have not been able to replicate it. Let's say you have a section called General Information with the menu alias general-info. So your section link might be to yoursite.com/general-info. Images in the section description do not contain the leading slash: it would be something like src="images/folder1/image3.jpg". But if you don't have a slash at the end of your URL, the relative path to the image would still evaluate to yoursite.com/images/folder1/image3.jpg, which is indeed the correct path. So if you navigate to that page, the image will show up and you may think there is no error, though if you check the source you'll see that the src does not have the leasing slash. But if you have a slash at the end of your URL (such as yoursite.com/general-info/), the path of the image would evaluate to yoursite.com/general-info/images/folder1/image3.jpg, which is incorrect, and you won't see the image. So just remember to check the source and not just look at whether the image shows up on the page.

So please be sure when trying to replicate this error that:
1. The image is coming from the description field, not from the section/category image selection dropdowns.
2. You are using SEF URLs.
3. You are at a page other than the home page, at least one "folder" deep (and with a slash at the end if you are exactly one folder deep). Though, even at the home page level, the error occurs, you just will see the image anyway, so...
4. Don't assume it works if the image shows up - check for the leasing slash in the img src in the page source.

User avatar
tcp
Joomla! Ace
Joomla! Ace
Posts: 1548
Joined: Wed Sep 21, 2005 9:25 am
Location: Thailand
Contact:

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by tcp » Sat Dec 08, 2007 2:54 am

OK, I can confirm this in Rev 9487 .

Sorry if I didn't understand the problem at first - I do a lot of skimming for information, sometimes don't read the details.

The problem is specifically when you try to add an image into the description of the section.  The img src is a relative path, not the absolute path that we need.

Code: Select all

<img src="/j/images/stories/clock.jpg" alt="clock.jpg" align="left" hspace="6">
	<p>A description.  Now let's insert the image keys.</p><p><img src="images/stories/key.jpg" border="0"> </p><p>Did you see the image? </p>


Note the second img tag.

OK, thanks for sticking with this.  If one doesn't exist already, please file this bug on Joomlacode and post a reference to this thread.

tcp
You do not have the required permissions to view the files attached to this post.
Your solution for a single-page checkout on any website.
http://moolah-ecommerce.com

User avatar
tcp
Joomla! Ace
Joomla! Ace
Posts: 1548
Joined: Wed Sep 21, 2005 9:25 am
Location: Thailand
Contact:

Re: [INFO REQUESTED] Images not showing up on category/section description

Post by tcp » Sat Dec 08, 2007 3:24 am

Just an update.  I walked through the code and found that src links are updated using the content plugin sef ( function plgContentSEF() ).  This performs the magic of converting the relative paths to absolute paths.  Obviously this is not happening for other text strings, such as section and category descriptions.

Now sure what is the best solution for this.  I'm wondering if this code should be located outside of the content plugin so that we could have an API to transform any text string, not just $row->text.

Code: Select all

//Replace src links
$base = JURI::base(true).'/';
$row->text = preg_replace("/(src)=\"(?!http|ftp|https)([^\"]*)\"/", "$1=\"$base\$2\"", $row->text);
	
//Replace href links
$regex = "#href=\"(.*?)\"#s";

// perform the replacement
$row->text = preg_replace_callback( $regex, 'plgContentSEF_replacer', $row->text );
It seems like we need this functionality as a system plugin.

tcp

--edit

This may sound crazy, but could this be done with the event onAfterRender ?  We know that any src that is a relative path ( not http://site/path or /path ) will not work with SEF on.  Can we parse the entire output buffer looking for broken src attributes and fix them all in one evil, foul swoop ?  If so, we can address all SEF bugs in one spot.  When is a relative path correct when SEF is enabled?

tcp
Last edited by tcp on Sat Dec 08, 2007 9:48 am, edited 1 time in total.
Your solution for a single-page checkout on any website.
http://moolah-ecommerce.com

User avatar
tcp
Joomla! Ace
Joomla! Ace
Posts: 1548
Joined: Wed Sep 21, 2005 9:25 am
Location: Thailand
Contact:

Re: [CONFIRMED] Images not showing up on category/section description

Post by tcp » Sat Dec 08, 2007 12:44 pm

Your solution for a single-page checkout on any website.
http://moolah-ecommerce.com

TracyDoesPHP
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Sep 06, 2007 10:22 pm

Re: [CONFIRMED] Images not showing up on category/section description

Post by TracyDoesPHP » Thu Feb 07, 2008 10:28 pm

Just wanted to report that I upgraded to Joomla 1.5.0 (stable) and this problem seems to be fixed. Whether the image is in an article or a section or category description, it correctly has one slash before the images folder in the image src. Interestingly, it now works no matter what you do. I have WysiwygPro installed as the editor, and it inserts the leading slash for you. Previously, Joomla was adding a leading slash to all articles and no leading slash to descriptions. So when using the editor to insert an image rather than the Joomla image insertion button, there was second slash at the beginning of the src in articles and just one slash (the one already inserted by WysiwygPro) in descriptions. Now, it seems to be smart. It seems to be looking at the existing path and only inserting the leading slash if needed. In 1.5 stable, I've found that there is exactly one leading slash, whether it's an article or description, and and whether or not the image button you used inserted the slash for you.

Hoorah! You can probably mark this thread as fixed.

vladhav
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Sep 04, 2010 2:30 am

Re: [CONFIRMED] Images not showing up on category/section de

Post by vladhav » Sat Sep 04, 2010 2:37 am

it's a matter of editor + joomla bug + that "/" for example:
if you insert the image using the insert image button, then you get it without a "/" and it doesn't work with SEF , if you add a "/"

Code: Select all

<img src="/images/stories/joomla-dev_cycle.png" alt="" />

it works

problem is that most editors take out that "/" after you insert it using plain html, so you have to use no editor or find one that works.

if your using JCE you can Set 'Relative URLS' to 'No' in the JCE Group Manager Editor Parameters, and you will have full link to image, which also works.

wtrevenzoli
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Feb 07, 2010 5:48 pm

Re: [CONFIRMED] Images not showing up on category/section de

Post by wtrevenzoli » Sat Jan 15, 2011 5:33 pm

I was having similar issue with some images inserted in the body of articles. Sometimes the preceding slash was showing up, and more often no (so the image). It was happening with or without the SEF URL, Rewrite on or off, and with or without other suspicious plug-ins. Don't know why this random behavior: maybe some quick fix trying to deal with a related error?

I'm using JCE, and following vladhav's lead I had this specific problem completely solved. Obviously, I created in JCE a Super Editor group with his recomended change and some more liberal settings.

Thx everybody and special thx to vladhav!

asomerville
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jun 17, 2011 5:31 pm

Re: [CONFIRMED] Images not showing up on category/section de

Post by asomerville » Fri Jun 17, 2011 5:36 pm

Is there anyway to get the image to view without using code. I am not super great with code.

Attached is what I have on the page. Article and Image. When I save the changes the image does not appear as it should.
You do not have the required permissions to view the files attached to this post.

User avatar
Chacapamac
Joomla! Guru
Joomla! Guru
Posts: 983
Joined: Wed Feb 20, 2008 6:50 am
Location: Canada, Montreal
Contact:

Re: [CONFIRMED] Images not showing up on category/section de

Post by Chacapamac » Sat Nov 19, 2011 11:35 pm

Having the problem with a joomla 1.5.23, curiously even images outside the blog itself (in other modules) loose their /
I’m not to sure how you guys fix that?

WARNING ABOUT THAT SOLUTION
if your using JCE you can Set 'Relative URLS' to 'No' in the JCE Group Manager Editor Parameters, and you will have full link to image, which also works.
That will give full url to all images in your articles and can result in nightmerish scenario wher you will have hundreds of broken images if the site change URL (e.g:localhost) I do not recommend that...

This happen in this 1.5.23 site http://www.editionzoneshockey.com/ if you fool around back and for in the blog sections, at some points the images loose their leading slashes

Blogs sections:
http://www.editionzoneshockey.com/fr/le ... mestre-ezh
All my journalists blog are the same, I really need help on this one, this need to be fix...


Only Joomla SEF with sef plugin enabled — I don’t understand , no major modif on that site — Was working ok Before

What is the solution
Can God help us?
Marketing, SEO, Web development - Powered by Joomla!
http://www.grafcomm.ca/

User avatar
Chacapamac
Joomla! Guru
Joomla! Guru
Posts: 983
Joined: Wed Feb 20, 2008 6:50 am
Location: Canada, Montreal
Contact:

Re: [CONFIRMED] Images not showing up on category/section de

Post by Chacapamac » Sun Nov 20, 2011 2:23 am

Seem only in Firefox — I relly don’t understand the problem...

many years of experience in joomla, but this time I’m a little bit in a panic state.
I really don’t know what to do???

UPDATE — Nope SAME In Safari ,,,, help!
Can God help us?
Marketing, SEO, Web development - Powered by Joomla!
http://www.grafcomm.ca/

cjmacd
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu May 18, 2006 2:33 am
Contact:

Re: [CONFIRMED] Images not showing up on category/section de

Post by cjmacd » Sat Nov 26, 2011 4:30 pm

we found this same problem at

http://www.iwebwork.com

When we upgraded to j 1.5.23

With 1.5.25 we still see the same problem

will post additional info or solution once we find it.
...

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39712
Joined: Sat Apr 05, 2008 9:58 pm

Re: [CONFIRMED] Images not showing up on category/section de

Post by Webdongle » Sat Nov 26, 2011 4:41 pm

The problem is the z-index in your Template's css because the image is being reached and is displaying but you have a layer on top of it blocking it out.
Screenshot-904.png
Screenshot-905.png
You do not have the required permissions to view the files attached to this post.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

cjmacd
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu May 18, 2006 2:33 am
Contact:

Re: [CONFIRMED] Images not showing up on category/section de

Post by cjmacd » Sat Nov 26, 2011 5:50 pm

Webdongle wrote:The problem is the z-index in your Template's css because the image is being reached and is displaying but you have a layer on top of it blocking it out.
thank you for this response Webdongle

I thought that this could be an issue. But it was strange that the issue was only introduced after a an upgrade of core files from j1.5.14 to j1.5.23 and then to 1.5.25

Nothing was changed to any template files during that process.

Just to cover bases I increased the z-index of #tabs_holder to a large number as well as removing / renaming the blue background image adverttabs_bg.gif to rule out something covering it up.

Right now if that image is being pulled it should be displayed.

I did notice that the trailing slash issue with certain images found by other in this thread
was affecting 3 of them (one being an absolute url to http://www.iwebwork.com/images/stories/ ... k-tab1.jpg)

it only seems to affect the banner images

and the portfolio component at http://www.iwebwork.com/portfolio/web-design

Both may be separate problems but this only came up after an upgrade.
...

User avatar
Chacapamac
Joomla! Guru
Joomla! Guru
Posts: 983
Joined: Wed Feb 20, 2008 6:50 am
Location: Canada, Montreal
Contact:

Re: [CONFIRMED] Images not showing up on category/section de

Post by Chacapamac » Sun Nov 27, 2011 12:59 pm

It seem to be fixed for me

The best ordering for your system plugins is:
• Any other plugins
• SEO and SEF plugins
• Cache plugins
If your Cache plugin is ordered before others, those plugins will not have any effect on the output as long as the content is cached. So make sure your Cache plugin has the highest ordering number.
Also think about what plugins effect other plugins and what the logical order would be for these to be in.
Example: If you have a plugin that places contact information and another that converts email addresses to links to your contact page, then they should be executed in that order.
Tip: Clean your cache after changing your plugin order. Otherwise you might not see the effect.
Can God help us?
Marketing, SEO, Web development - Powered by Joomla!
http://www.grafcomm.ca/

cjmacd
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu May 18, 2006 2:33 am
Contact:

Re: [CONFIRMED] Images not showing up on category/section de

Post by cjmacd » Sun Nov 27, 2011 1:35 pm

hrrmm I'm going to try that

Just for quick clarification

when you say cache being highest ordering number do you mean 0 - 1 order number

so if the plugins page was looked at in order it would go (from top down)

Cache plugins

SEO - SEF Plugins

Other Plugins

?
...


Locked

Return to “Joomla! 1.5 Bug Reporting”