Skip to content

Commit 214fe91

Browse files
committed
Changed Error when thumbnail missing
- Don't abort with error - Remove thumbnail marker in db - Display an alert for info
1 parent b8a113c commit 214fe91

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

imcger/imgupload/controller/save_rotated_img_controller.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ public function save_image()
166166
}
167167
else if ($img_data['thumbnail'])
168168
{
169-
$this->json_response(4, $ext_display_name, $this->language->lang('IUL_THUMB_NOT_EXIST'));
169+
$img_data['thumbnail'] = 0;
170+
$alert_msg = $this->language->lang('IUL_THUMB_NOT_EXIST');
170171
}
171172

172173
// Update DataBase
@@ -182,7 +183,7 @@ public function save_image()
182183
$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . ' WHERE attach_id = ' . (int) $img_attach_id;
183184
$this->db->sql_query($sql);
184185

185-
$this->json_response(0, $ext_display_name, '', $img_attach_id, $new_attach_id);
186+
$this->json_response(0, $ext_display_name, $alert_msg ?? '', $img_attach_id, $new_attach_id);
186187
}
187188
else
188189
{

imcger/imgupload/language/de/attachment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
'IUL_REQUEST_ERROR' => 'Bei der Anfrage ist ein Fehler aufgetreten.',
4545
'IUL_WRONG_PARAM' => 'Falsche Parameter gesendet.',
4646
'IUL_NO_IMG_IN_DATABASE' => 'Das Bild wurde nicht in der Datenbank gefunden.',
47-
'IUL_IMG_NOT_EXIST' => 'Das Bild existiert nicht.',
48-
'IUL_THUMB_NOT_EXIST' => 'Das Vorschaubild existiert nicht.',
47+
'IUL_IMG_NOT_EXIST' => 'Die Bilddatei existiert nicht.',
48+
'IUL_THUMB_NOT_EXIST' => 'Das erwartete Vorschaubild existiert nicht. ',
4949
'IUL_DATABASE_NOT_UPDATE' => 'Die Datenbank konnte nicht aktualisiert werden.',
5050
]);

imcger/imgupload/language/de_x_sie/attachment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
'IUL_REQUEST_ERROR' => 'Bei der Anfrage ist ein Fehler aufgetreten.',
4545
'IUL_WRONG_PARAM' => 'Falsche Parameter gesendet.',
4646
'IUL_NO_IMG_IN_DATABASE' => 'Das Bild wurde nicht in der Datenbank gefunden.',
47-
'IUL_IMG_NOT_EXIST' => 'Das Bild existiert nicht.',
48-
'IUL_THUMB_NOT_EXIST' => 'Das Vorschaubild existiert nicht.',
47+
'IUL_IMG_NOT_EXIST' => 'Die Bilddatei existiert nicht.',
48+
'IUL_THUMB_NOT_EXIST' => 'Das erwartete Vorschaubild existiert nicht. ',
4949
'IUL_DATABASE_NOT_UPDATE' => 'Die Datenbank konnte nicht aktualisiert werden.',
5050
]);

imcger/imgupload/styles/all/template/event/overall_footer_body_after.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@
231231
if (json.status < 3) {
232232
imcger.imgUpload.updateAttId(json.oldAttachId, json.newAttachId);
233233
imcger.imgUpload.image.imgOrientationValue[index] = 0;
234+
235+
// Display a message when a warning occurs
236+
if (json.message) {
237+
phpbb.alert(json.title, json.message);
238+
}
234239
} else if (json.status == 3) {
235240
window.location.assign(window.location.href.replace(window.location.hash, ''));
236241
} else {

0 commit comments

Comments
 (0)