Posts made by Simon Coggins

Ok, so interestingly, when I tried to access the URL in the error above it worked:

http://titwo.co/elearning/moodle/pluginfile.php?forcedownload=1&file=%2F5%2Fbadges%2Fuserbadge%2F10%2F55f4ab46cdbd929eb447de35d8ebef50ac30c264

The file is there and the url being accessed is correct.

Therefore it seems to be most likely to be due to a server configuration issue causing readfile() to fail on urls. You should check the 'allow_url_fopen' setting in your php.ini file. It needs to be enabled for that call to work.

I must confess I'm a bit surprised that an external url is being passed to readfile like that. It seems like it would be better to generate a file system path.

Either way I still think it would pay to report this as a bug as some code changes are most likely required.

Simon


I took a look at that file in a hex editor and instead of containing an image it contains the HTML of a webpage, including this error:

Warning: readfile(http://titwo.co/elearning/moodle/pluginfile.php?forcedownload=1&file=%2F5%2Fbadges%2Fuserbadge%2F10%2F55f4ab46cdbd929eb447de35d8ebef50ac30c264): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in D:\HostingSpaces\titwo.co\titwo.co\wwwroot\elearning\moodle\badges\badge.php on line 44

so there is definitely something going wrong with the badge creation process. I'm not sure at this stage whether it is a (windows specific?) badges bug, server permissions issue or something else.

Hopefully Yuliya (the component lead for Badges) will have some time in the next couple of days to take a look. At the very least it looks like the error handling could do with some improvement to explain that something went wrong rather than generating a bad badge file.

It would probably make sense to file a bug and include a copy of the badge in the Moodle tracker.

Simon

Hi Davo,

I've come across the same issue as you with Totara dialogs. I agree that what you are suggesting would be a nice core extension and useful in some scenarios though like David I would worry a bit about performance.

At the same time I also think we (at Totara) should extend behat_selectors.php to either add a new 'totara_dialog' selector or extend the existing 'dialogue' selector that Tim mentioned to handle our JQuery dialogs. That would allow you to do what Tim suggested:

And I click on the "Close" "button" in the "Choose organisation" "dialogue"

Which would be the most robust approach in my opinion.

Simon

The characters are not being stripped out of the HTML page source, it's just that HTML doesn't render white space in the source (you need to use tags).

We have a fix that converts new lines to HTML <br> tags which will make the descriptions look a lot better.

Simon