Image : pluginfile.php problem after upgrading

Image : pluginfile.php problem after upgrading

by Julien Buabent -
Number of replies: 10

Hi ! I just upgraded my Moodle from 3.4 to 3.8 (and changing web server too..), and all my assets (img, videos, etc...) are not displayed correctly.

The new back-end give me this kind of url : pluginfile.php/959/mod_assign/intro/css-flexbox.mp4

And the old give me : pluginfile.php?file=/959/mod_assign/intro/css-flexbox.mp4


Why the new version not include the file param in URL to show correctly my images ? If I add file= in the new URL, it works...! 

I think it's a plugin problem, but I am not sure, and I dont remeber which plugin permits to fix this problem...

Anyone have an idea ?

Sorry for my bad english, thank you.


Average of ratings: -
In reply to Julien Buabent

Re: Image : pluginfile.php problem after upgrading

by Ken Task -
Picture of Particularly helpful Moodlers

Turn on debugging:

https://docs.moodle.org/38/en/Debugging

Also check your web server error logs for clues and share back clips of what you find.

'SoS', Ken

In reply to Ken Task

Re: Image : pluginfile.php problem after upgrading

by Julien Buabent -
I enabled the debug in developer mode, and i enabled "show error message", but nothing appears in courses and pages. (no warning, no errors, nada...)

Also, in the HTML code of my courses, img src attribute contains an url with draftfile.php. And not pluginfile.php like the rendering. What is draftfile.php ? There is the same problem, if I add the file= parameter in the draftfile.php path, the image is downloaded on my computer....

I really think it's just a plugin problem, I prefer don't touch the moodle code if it's possible...

For the websever error log : I just migrated to a new web server, and I don't know where are the moodle logs. There is a folder in moodle where the logs are stored ? Or do I need to configure logs manually ?

Thank you "SOS KEN" smile
In reply to Julien Buabent

Re: Image : pluginfile.php problem after upgrading

by Ken Task -
Picture of Particularly helpful Moodlers

Web server error logs ... apache/nginx or whatever your site runs for a web server.  Moodle is an application (php scripts) that runs under a web service.

Where those logs are located on your server depends upon operating system and what type of 'lease' you have with provider as well as provider.

Would imagine you have some sort of server panel (cPanel/other) and you should be able to find web service logs there.

When one migrates a site ... moves from one provider to another ... usually best to transfer a backup of the site ... which consist of moodle code, a database dump (.sql file), and an archive of the moodledata directory.   The code and moodledata should be uploaded to new site using binary mode if using FTP.

https://docs.moodle.org/38/en/Moodle_migration

Once on new site and up and running, site checked for errors and functionality.   The issue you are having now could have been there after transfer.   Once site checked and everything ok then one could do upgrades.

Sounds like you've tried to do migration + upgrade all at once and that could confuse moodle - and make it hard to troubleshoot.

'Spirit of Sharing (SoS)',  Ken

In reply to Ken Task

Re: Image : pluginfile.php problem after upgrading

by Julien Buabent -
ok its good, it was that : https://moodle.org/mod/forum/discuss.php?d=181931

I migrated from a shared host (1and1 for the frenchies who needs help), and I just replace the PATH_INFO in weblib.php by ORIG_PATH_INFO

But what about the next upgrades ?????

Thanks again Ken
In reply to Julien Buabent

Re: Image : pluginfile.php problem after upgrading

by Ken Task -
Picture of Particularly helpful Moodlers

Am confused ... "just upgraded my Moodle from 3.4 to 3.8 (and changing web server too)" ....  So what version are you running?  "Next upgrade????"

So which did you do first or did you do both at the same time?

So you've not found any web server error logs?

In current setup/server, check the environment.  Anything yellow there?

Ok, we see debug on something but it's in French ... mind translating ... I would have used Google Translator but you've provided image not text of debug.

Shouldn't have to hack any core code!  Change a setting or tweak web service ... outside of Moodle code ... but no hacks.  If you do, an un-wanted surprise might awaiting you on future upgrades ... like from 3.8.x to 3.9.x when 3.9 is released.

'SoS', Ken

In reply to Ken Task

Re: Image : pluginfile.php problem after upgrading

by Julien Buabent -
Breaking news...
Its Ato Editor that don't run correctly. When I add file= parameter directly in HTML section code, the image appears in the editor. But when I save my modifications, the image don't appear in "normal" course (student view). And when I look again in the HTML5 editor, the file= parameter disappear.
So : Ato rewrite my URL....
What a pain ! (correct expression ?)

I a ma going to looking in this direction.
In reply to Ken Task

Re: Image : pluginfile.php problem after upgrading

by Julien Buabent -
when I open the file link in another tab, i got that :

pluginfile.php/641/course/section/796/easy-work.png

sss
In reply to Julien Buabent

Re: Image : pluginfile.php problem after upgrading

by Julien Buabent -
I fix properly the bug with these steps :
- modify $CFG->slasharguments = false; (config.php)
- add php.ini to the moodle root folder, and write cgi.fix_pathinfo = 0 inside

This bug is describe on the slash argument doc, and there is a particular case for the 1and1 instalaltion....
In reply to Julien Buabent

Re: Image : pluginfile.php problem after upgrading

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Julien,
enabling Moodle slash arguments will become "the actual default" in the future - not tomorrow, probably not this year, who knows: MDL-62640.

That being said, it has been always required for some activities e.g. SCORM.

HTH,
Matteo

Average of ratings: Useful (1)
In reply to Julien Buabent

Re: Image : pluginfile.php problem after upgrading

by Ken Task -
Picture of Particularly helpful Moodlers
Very good! Congrats! Would encourage you to find out all you can about set up ... where things are located, etc. and record that info in something you have locally or even in your profile here.
Sounds like you might on a system that creates error_log files in the code directory where the error occurs. Thus, might have to use cPanel's file browsing to search the entire code base for 'error_log' files. Plus any additional protects ... like mod_security or securi ... those have rules that could be triggered by legit actions in moodle code. Those added on protections also falsely report things like error 500's to hide from would be hackers.
Anyhoooo ... thanks Matteo for reminding me (again) ... and again congrats on finding resolution to your own problem!

'SoS', Ken