Broken images in 2.5.1

Broken images in 2.5.1

by Art Lader -
Number of replies: 27

Greetings Fellow Moodlers,

Well, this is odd. My images are breaking in an installation of Moodle that has been fine until now (version 2.5.1).

Where I had been seeing images, I am now seeing html like this:

www.ahsgerman.com/vle/pluginfile.php?file=/110/mod_book/chapter/27/sophias%20pictures%201.jpg" alt="sophia 1" height="320" width="240" />

www.ahsgerman.com/vle/pluginfile.php?file=/110/mod_book/chapter/27/sophias%20pictures%202.jpg" alt="sophia 2" style="border: 2px solid black;" height="320" width="240" />

www.ahsgerman.com/vle/pluginfile.php?file=/110/mod_book/chapter/27/sophias%20pictures%203.jpg" alt="sophia 3" style="border: 2px solid black;" height="320" width="240" />

www.ahsgerman.com/vle/pluginfile.php?file=/110/mod_book/chapter/27/sophias%20pictures%204.jpg" alt="sophia 4" style="border: 2px solid black;" height="240" width="320" />

www.ahsgerman.com/vle/pluginfile.php?file=/110/mod_book/chapter/27/sophias%20pictures%205.jpg" alt="sophia 5" style="border: 2px solid black;" height="240" width="320" />

I installed another instance of 2.5.1 on the same server and did not have this problem, by the way.

I have looked for strange entries in the database, but have not found any.

Have been playing with various settings, but have had no luck.

I have tried changing themes, but that did not help.

I am seeing this everywhere including the forums, but not when I attach an image to a forum post. Attached images are not broken.

Have any of you run into this before? Do you have any advice for me?

Thanks,

Art

 

Average of ratings: -
In reply to Art Lader

Re: Broken images in 2.5.1

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

That's interesting...

What happens when you turn off the Use slash arguments option under Site administration / Server / HTTP?

Average of ratings:Useful (1)
In reply to Luis de Vasconcelos

Re: Broken images in 2.5.1

by Art Lader -

Hi, Luis,

Thanks for getting back to me.

Forgot to mention that I have already turned off slash arguments.

Art

In reply to Art Lader

Re: Broken images in 2.5.1

by Scott Karren -

Art

I took a look at your website and noticed a funny thing.  If I go to the course in the screenshot below I see a broken image (fyi, I am using Chrome).

 

If I right click on the image and select "open image in new tab" I get a redirect message and am taken to the home page of your site.

 

Is it possible that something on the network has changed?

HTH

Scott

Average of ratings:Useful (1)
In reply to Scott Karren

Re: Broken images in 2.5.1

by Art Lader -

Hi, Scott,

You are right. I noticed that, too. I keep playing around with the HTML, but it does not help.

The fragments do contain the "www" bit: 

www.ahsgerman.com/vle/pluginfile.php?file=/110/mod_book/chapter/27/sophias%20pictures%201.jpg" alt="sophia 1" height="320" width="240" />

Profile pictures show up. Attachment images show up.

Weird, isn't it?

Thanks,
Art

In reply to Art Lader

Re: Broken images in 2.5.1

by Art Lader -

Okay, let's try this: I am going to re-upload all the Moodle files and copy over the config file to the new installation. Maybe it will be that easy. 

Art

In reply to Art Lader

Re: Broken images in 2.5.1

by Ken Task -
Picture of Particularly helpful Moodlers

Only other thing (thanks for listing all the things you've tried) ... purge the cache.  If the other 2.5.1 site you installed works in another instance in the same environment, the only diff in environments might be the cache.

'spirit of sharing', Ken

Average of ratings:Useful (1)
In reply to Ken Task

Re: Broken images in 2.5.1

by Art Lader -

Duh. blush

Why have I not done that yet?

Thanks,

Art

In reply to Art Lader

Re: Broken images in 2.5.1

by Art Lader -

Grrr... No joy, I am afraid.

Art

In reply to Art Lader

Re: Broken images in 2.5.1

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

Ummm... Check the end of your config file. Anything unusual there like the closing php tag?

Average of ratings:Useful (1)
In reply to Art Lader

Re: Broken images in 2.5.1

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

Right-click on one of the "red-cross" placeholders on http://www.ahsgerman.com/vle/mod/book/view.php?id=34&chapterid=27 and it shows a strange, invalid URL like:

http://%3ca%20href=/

Which translates to:

http://< href=/

and isn't valid. So something is breaking your url's.

Average of ratings:Useful (1)
In reply to Luis de Vasconcelos

Re: Broken images in 2.5.1

by Scott Karren -

What happens if you put a new image and link up?  Do you get the same mangled href or does it work?  If the new file and link work then I would start looking at the database records for those files affected.

If it doesn't work...Hmm... have you checked the config changes report to see if anything has been changed other than what you have done? I still wonder if something has changed on your network side that would be affecting the hrefs.

Scott

Average of ratings:Useful (1)
In reply to Scott Karren

Re: Broken images in 2.5.1

by Art Lader -

Sigh... New file = 

In reply to Art Lader

Re: Broken images in 2.5.1

by Art Lader -

Not happening on my Wordpress sites on the same server. dead

In reply to Art Lader

Re: Broken images in 2.5.1

by Scott Karren -

Art

I just re-read your original post and I want to back up for a minute.  You say this was working fine until 2.5.1, did you recently upgrade?  

Then you said that you setup another 2.5.1 instance and did not have the same issues. Did you use the same downloaded files or did you re-download?

What would happen if you took the filebase from the instance that was working and copied them to the one that isn't, or downloaded 2.5.1 again and copied it into the instance that isn't working?

Maybe I'm grasping at straws right now but is it possible that the download was corrupt?

Scott

Average of ratings:Useful (1)
In reply to Scott Karren

Re: Broken images in 2.5.1

by Art Lader -

Actually, I set up an instance of Moodle using Scriptalicious and copied over the config file from the original Moodle to the new one.

I think I am going to wait until tomorrow and and take another shot at it with fresh eyes, Scott.

Thank you so much for working with me on this! I very much appreciate it.

Regards,
Art

In reply to Art Lader

Re: Broken images in 2.5.1

by Christian Herman -

Another Moodler had similar weird code changes due to the HTML filter getting turned on.  I assume you're only having the problem with images added via the text editor?

https://moodle.org/mod/forum/discuss.php?d=231543#p1006860

Average of ratings:Useful (1)
In reply to Christian Herman

Re: Broken images in 2.5.1

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

yeah - it's an issue with the filters - one of our clients reported an issue yesterday so I disabled that filter and it fixed it. I'll take another look today and log an issue.

Average of ratings:Useful (2)
In reply to Dan Marsden

Re: Broken images in 2.5.1

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

the cause appears to be the patch in MDL-22390

Average of ratings:Useful (2)
In reply to Dan Marsden

Re: Broken images in 2.5.1

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

bug report for this issue here: MDL-40633

Average of ratings:Useful (2)
In reply to Dan Marsden

Re: Broken images in 2.5.1

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

OK, I have done a fix for MDL-40633. If anyone can test that patch before it gets integrated next week, that would be very helpful.

In reply to Tim Hunt

Re: Broken images in 2.5.1

by Art Lader -
In reply to Art Lader

Re: Broken images in 2.5.1

by Art Lader -

Sigh... Images are breaking again.

In reply to Art Lader

Re: Broken images in 2.5.1

by Art Lader -

Never mind. Applied suggested fix to filter.php and all is well.

In reply to Art Lader

Re: Broken images in 2.5.1

by sid hashem -
ello All I am setting up a site for a friend in moodle. We want to make a page for student and after login they are directed to that page. At present, any registered user will see the same page, that is homepage, as they login. We want this to be changed and if a student logs in they are directed to a Page that I have created with some instruction in it. Is there anyway to do this. Kind regards Sid
In reply to Christian Herman

Re: Broken images in 2.5.1

by Art Lader -

"... only having the problem with images added via the text editor?"

Yes, that is right, Christian.