2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
'#size'=>15,'#maxlength'=>10,'#description'=>t('The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 for no restriction.')
'#size'=>15,'#maxlength'=>10,'#description'=>t('The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 for no restriction.')
);
);
$form['settings_general']['upload_list_default']=array('#type'=>'select','#title'=>t('List files by default'),
form_set_error('upload',t('The selected file %name can not be attached to this post, because it is only possible to attach files with the following extensions: %files-allowed.',array('%name'=>theme('placeholder',$file->filename),'%files-allowed'=>theme('placeholder',$extensions))));
form_set_error('upload',t('The selected file %name can not be attached to this post, because it is only possible to attach files with the following extensions: %files-allowed.',array('%name'=>theme('placeholder',$file->filename),'%files-allowed'=>theme('placeholder',$extensions))));
form_set_error('upload',t('The selected file %name can not be attached to this post, because it exceeded the maximum filesize of %maxsize.',array('%name'=>theme('placeholder',$file->filename),'%maxsize'=>theme('placeholder',format_size($uploadsize)))));
form_set_error('upload',t('The selected file %name can not be attached to this post, because it exceeded the maximum filesize of %maxsize.',array('%name'=>theme('placeholder',$file->filename),'%maxsize'=>theme('placeholder',format_size($uploadsize)))));
form_set_error('upload',t('The selected file %name can not be attached to this post, because the disk quota of %quota has been reached.',array('%name'=>theme('placeholder',$file->filename),'%quota'=>theme('placeholder',format_size($usersize)))));
form_set_error('upload',t('The selected file %name can not be attached to this post, because the disk quota of %quota has been reached.',array('%name'=>theme('placeholder',$file->filename),'%quota'=>theme('placeholder',format_size($usersize)))));
db_query("UPDATE {file_revisions} SET list = %d, description = '%s' WHERE fid = %d AND vid = %d",$node->list[$key],$node->description[$key],$key,$node->vid);
db_query("UPDATE {file_revisions} SET list = %d, description = '%s' WHERE fid = %d AND vid = %d",$file->list,$file->description,$file->fid,$node->vid);
}
}
}
}
...
@@ -446,20 +491,18 @@ function upload_delete($node) {
...
@@ -446,20 +491,18 @@ function upload_delete($node) {
}
}
foreach($filesas$fid=>$file){
foreach($filesas$fid=>$file){
// delete all file revision information associated with the node
// Delete all file revision information associated with the node
db_query('DELETE FROM {file_revisions} WHERE fid = %d',$fid);
db_query('DELETE FROM {file_revisions} WHERE fid = %d',$fid);
file_delete($file->filepath);
file_delete($file->filepath);
}
}
// delete all files associated with the node
// Delete all files associated with the node
db_query('DELETE FROM {files} WHERE nid = %d',$node->nid);
db_query('DELETE FROM {files} WHERE nid = %d',$node->nid);
}
}
functionupload_delete_revision($node){
functionupload_delete_revision($node){
$files=upload_load($node);
foreach($node->filesas$file){
// Check if the file will be used after this revision is deleted
foreach($filesas$file){
// check if the file will be used after this revision is deleted
$count=db_result(db_query('SELECT COUNT(fid) FROM {file_revisions} WHERE fid = %d',$file->fid));
$count=db_result(db_query('SELECT COUNT(fid) FROM {file_revisions} WHERE fid = %d',$file->fid));
// if the file won't be used, delete it
// if the file won't be used, delete it
...
@@ -473,6 +516,7 @@ function upload_delete_revision($node) {
...
@@ -473,6 +516,7 @@ function upload_delete_revision($node) {
db_query('DELETE FROM {file_revisions} WHERE vid = %d',$node->vid);
db_query('DELETE FROM {file_revisions} WHERE vid = %d',$node->vid);