Merge branch '3.4' into 3

This commit is contained in:
Daniel Hensby 2016-09-23 16:33:45 +01:00
commit 6022012481
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
3 changed files with 7 additions and 5 deletions

View File

@ -89,11 +89,12 @@ class Debug {
*/ */
public static function caller() { public static function caller() {
$bt = debug_backtrace(); $bt = debug_backtrace();
$caller = $bt[2]; $caller = isset($bt[2]) ? $bt[2] : array();
$caller['line'] = $bt[1]['line']; $caller['line'] = $bt[1]['line'];
$caller['file'] = $bt[1]['file']; $caller['file'] = $bt[1]['file'];
if(!isset($caller['class'])) $caller['class'] = ''; if(!isset($caller['class'])) $caller['class'] = '';
if(!isset($caller['type'])) $caller['type'] = ''; if(!isset($caller['type'])) $caller['type'] = '';
if(!isset($caller['function'])) $caller['function'] = '';
return $caller; return $caller;
} }

View File

@ -268,10 +268,11 @@ However you might have several entries with the same `FirstName` and would like
'LastName'=>'ASC' 'LastName'=>'ASC'
)); ));
You can also sort randomly. You can also sort randomly. Using the `DB` class, you can get the random sort method per database type.
:::php :::php
$players = Player::get()->sort('RAND()') $random = DB::get_conn()->random();
$players = Player::get()->sort($random)
## Filtering Results ## Filtering Results

View File

@ -263,8 +263,8 @@
}, },
openSelectDialog: function(uploadedFile) { openSelectDialog: function(uploadedFile) {
// Create dialog and load iframe // Create dialog and load iframe
var self = this, config = this.getConfig(), dialogId = 'ss-uploadfield-dialog-' + this.attr('id'), dialog = jQuery('#' + dialogId); var self = this, config = this.getConfig(), dialogId = 'ss-uploadfield-dialog-' + this.attr('id'), dialog = $('#' + dialogId);
if(!dialog.length) dialog = jQuery('<div class="ss-uploadfield-dialog" id="' + dialogId + '" />'); if(!dialog.length) dialog = $('<div class="ss-uploadfield-dialog" id="' + dialogId + '" />');
// If user selected 'Choose another file', we need the ID of the file to replace // If user selected 'Choose another file', we need the ID of the file to replace
var iframeUrl = config['urlSelectDialog']; var iframeUrl = config['urlSelectDialog'];