Merge pull request #4023 from CHItA/ticket/14277

[ticket/14277] Fix undefined index error in migrations
This commit is contained in:
Marc Alexander 2015-11-09 14:32:24 +01:00
commit 5739317567
2 changed files with 14 additions and 2 deletions

View file

@ -243,8 +243,20 @@
*/
function parseMessage(messageJSON) {
$('#loading_indicator').css('display', 'none');
var responseObject;
var responseObject = JSON.parse(messageJSON);
try {
responseObject = JSON.parse(messageJSON);
} catch (err) {
if (window.console) {
console.log('Failed to parse JSON object\n\nMessage: ' + err.message + '\n\nServer Response: ' + messageJSON);
} else {
alert('Failed to parse JSON object\n\nMessage: ' + err.message + '\n\nServer Response: ' + messageJSON);
}
resetPolling();
return;
}
// Parse object
if (responseObject.hasOwnProperty('errors')) {

View file

@ -262,7 +262,7 @@ class module implements \phpbb\db\migration\tool\tool_interface
// Success
$module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']);
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name));
$phpbb_log->add('admin', (isset($user->data['user_id'])) ? $user->data['user_id'] : ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name));
// Move the module if requested above/below an existing one
if (isset($data['before']) && $data['before'])