Limekiller / moodle-block_openai_chat

An AI chat block for Moodle, powered by GPT
https://moodle.org/plugins/block_openai_chat
GNU General Public License v3.0
29 stars 18 forks source link

Icons broken in Moodle 4.1, 4.2, 4.3 and 4.4 #60

Closed michael-milette closed 4 months ago

michael-milette commented 4 months ago

It could be just me but I am not seeing the icons in Moodle 4.1 with the latest release of the Open AI Chat block on Moodle 4.1 with PHP 8.1.

image

Do they appear for you?

michael-milette commented 4 months ago

I just tried it in Moodle 4.2 and 4.3 and see the same broken icons.

michael-milette commented 4 months ago

I just upgraded this plugin in Moodle 4.4 from release 2024021400, which was working fine, up to 2024040800 which now has the broken icons too.

I confirmed that the problem exists with the following themes (did not try others): Boost, Classic and Trema.

michael-milette commented 4 months ago

The problem is that your URL's are not relative to the Moodle webroot but to the webservers webroot. For example, if I have Moodle installed in /moodle/, the URL to the SVG file should be:

/moodle/blocks/openai_chat/pix/arrow-right.svg

But, the way it is coded, the icons would only work if Moodle was installed in the root of the web server:

/blocks/openai_chat/pix/arrow-right.svg

I've submitted a PR #61 to address this issue. I would be thankful if you would be so kind as to please review and integrate as soon as possible.

Best regards,

Michael Milette