Skip to content

Commit

Permalink
Fix - PHP: File information for multiple fields from the same table w…
Browse files Browse the repository at this point in the history
…ould result in only one field getting the file information

- https://datatables.net/forums/discussion/comment/143548
  • Loading branch information
AllanJard committed Nov 28, 2018
1 parent fc9dcaf commit b2f3827
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1411,10 +1411,6 @@ private function _fileDataFields ( &$files, $fields, $limitTable, $ids=null, $da
continue;
}

if ( isset( $files[ $table ] ) ) {
continue;
}

// Make a collection of the ids used in this data set to get a limited data set
// in return (security and performance)
if ( $ids === null ) {
Expand Down Expand Up @@ -1443,7 +1439,12 @@ private function _fileDataFields ( &$files, $fields, $limitTable, $ids=null, $da
$fileData = $upload->data( $this->_db, $ids );

if ( $fileData !== null ) {
$files[ $table ] = $fileData;
if ( isset($files[$table]) ) {
$files[$table] = $files[$table] + $fileData;
}
else {
$files[$table] = $fileData;
}
}
}
}
Expand Down

0 comments on commit b2f3827

Please sign in to comment.