Images not working - Upgrade from 3.4 to 3.8

Re: Images not working - Upgrade from 3.4 to 3.8

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

There isn't a cli script that specifically addresses the issue your site has.   But a clue is 'draft' status ... as opposed to other designator that is working.

Have you looked at scheduled task on your new site?

via CLI ... cd admin/tool/task/cli

php schedule_task.php --list

Will show all the task scheduled ...

2 might be releated ...

\core\task\cache_cleanup_task

\core\task\cache_cron_task

Due to moving of moodledata and thus filedir as well, check ownerships permissions on moodledata/filedir and all folders files in filedir.   They might have changed.

And using a known graphic file humanly recognizable name that isn't displaying, might query your DB to see what's up.

Use DB for Moodle, then query something like:

mysql> select filename,filesize,status,contenthash from mdl_files where filename like '%.png';

Run above first to see that works.

Then change filename like to filename='humanlygivenfilename.extention'

The image filename is, of course, the one that won't display.

Is it there in DB meta data?  Probably is ...

Now to see if it's physically in moodledata/filedir/

cd moodledata/filedir/

find ./ -name 'contenthashvalue' (as seen in query)

That command might take some to depending upon size of filedir.

Example:

| timeline.png                             |    15922 |      0 | 0d248ec0e528a005e139bf3a946254a81c16e55a

again using example data above:

in moodledata/filedir/

[root@sos filedir]# find ./ -name 0d248ec0e528a005e139bf3a946254a81c16e55a

should respond with:

./0d/24/0d248ec0e528a005e139bf3a946254a81c16e55a

bolded above is the real file in moodle filing system.

To get an idea if it is a png ...

[root@sos filedir]# file -b ./0d/24/0d248ec0e528a005e139bf3a946254a81c16e55a
PNG image data, 352 x 260, 8-bit/color RGBA, non-interlaced

IF all above check out ... image should show! ;)

'SoS', Ken