General developer forum

"Auto" method for displaying URL resources

 
Picture of Raad Al-Rawi
"Auto" method for displaying URL resources
 

Hi All


We have come across an inconsistency in the way URL resources are handled by the "Auto" display method.

One of our users logged an issue with our Helpdesk because different URLs were behaving differently - one was just opening up when the link was clicked, the other was going to another Moodle page with the link displayed again, meaning a second click was required to get to the destination URL.

This was initially somewhat baffling, but once I had gone through the code at became apparent that this was the result of an interaction between some of the "rules" built into URL/link handling, namely in:

  • lib/resourcelib.php=>resourcelib_guess_url_mimetype()
  • mod/url/locallib.php=>url_get_final_display_type()

So a link containing "//" and no further slashes, or a link ending in a slash ends up as mime-type "text/html" and that is treated as a link to download, meaning it ends up going to url_print_workaround() and therefore displays on another page.

Our expectation around URL handling is that "Auto" will handle a straightforward URL like "http://www.cam.ac.uk" in the same way that "Open" does, and the extra page load plus extra click is, we feel, inconvenient.

Does anyone have any insight into why this is the chosen behaviour, and does anyone else find this undesirable?


Cheers


Raad

~~

Raad Al-Rawi
UIS & ICE Moodle Technical Developer/DBA
Turnitin Support Specialist

 

Teaching and Learning Systems Team,
University Information Services,
Roger Needham Building, 7 JJ Thomson Avenue,
Cambridge CB3 0RB UK

T: +44 (0)1223 760905
E: raad.al-rawi@uis.cam.ac.uk
W: http://www.uis.cam.ac.uk

 
Average of ratings: -
Picture of Raad Al-Rawi
Re: "Auto" method for displaying URL resources
 

Hello people - any opinions / thoughts on this?

Cheers


Raad

 
Average of ratings: -