### Eclipse Workspace Patch 1.0
#P 19stable
Index: mod/data/field/url/field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/field/url/field.class.php,v
retrieving revision 1.15.2.1
diff -u -r1.15.2.1 field.class.php
--- mod/data/field/url/field.class.php	30 May 2008 01:34:42 -0000	1.15.2.1
+++ mod/data/field/url/field.class.php	9 Jul 2009 12:16:03 -0000
@@ -132,6 +132,14 @@
         return $record->content . " " . $record->content1;
     }
 
+    function get_sort_field() {
+        if ($this->field->param1) { //if autolink then sort by the description otherwise by the actual URL
+            return 'content1';
+        } else {
+            return 'content';
+        }
+    }
+    
 }
 
 ?>
