From 28832a2540521a542bbffa1e33b3ae8f522b0785 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 2 Mar 2014 20:37:57 -0500 Subject: [PATCH 1/7] fixing bug where sometimes a pidfile was left over, and nodebb would refuse to start a daemon again. --- loader.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/loader.js b/loader.js index 2effb4ffa0..2ab9be2715 100644 --- a/loader.js +++ b/loader.js @@ -44,11 +44,18 @@ var nconf = require('nconf'), nconf.argv(); +// Start the daemon! if (nconf.get('d')) { // Check for a still-active NodeBB process if (fs.existsSync(pidFilePath)) { - console.log('\n Error: Another NodeBB is already running!'); - process.exit(); + try { + var pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' }); + process.kill(pid, 0); + console.log('\n Error: Another NodeBB is already running!'); + process.exit(); + } catch (e) { + fs.unlinkSync(pidFilePath); + } } // Initialise logging streams From 044347ebca2db18b6d1b527e164c332899325979 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 2 Mar 2014 22:02:55 -0500 Subject: [PATCH 2/7] hotfix for vanilla missing socket.io lib --- public/templates/header.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 56bfc48638..decbae43da 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -28,6 +28,7 @@ + From fc53385ede4e24e0960d7c5eba2a38a134bd4e04 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 2 Mar 2014 22:34:57 -0500 Subject: [PATCH 3/7] removing socket.io library from minfile --- src/meta.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/meta.js b/src/meta.js index 385e89e054..ce1cd70990 100644 --- a/src/meta.js +++ b/src/meta.js @@ -278,9 +278,6 @@ var fs = require('fs'), // Remove scripts that could not be found (remove this line at v0.5.0) Meta.js.scripts = jsPaths.filter(function(path) { return path !== null }); - // Add socket.io client library - Meta.js.scripts.push(path.join(__dirname, '../node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js')); - // Add plugin scripts Meta.js.scripts = Meta.js.scripts.concat(plugins.clientScripts); From 30e83fdabeb85f5ecbc4f86e463a5e0b598e6904 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2014 10:17:11 -0500 Subject: [PATCH 4/7] fixing upgrade script if order is not set --- src/upgrade.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/upgrade.js b/src/upgrade.js index 6aad843f05..0876aa7113 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -864,6 +864,12 @@ Upgrade.upgrade = function(callback) { if(err) { return next(err); } + + // If there was no order present, put it at the end + if (!order) { + order = cids.length; + } + db.sortedSetAdd('categories:cid', order, cid, next); }); }, function(err) { From 5a8fa9b1f7bd53c4ae8c2b9f466621855ea04897 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2014 11:07:37 -0500 Subject: [PATCH 5/7] fixed regression in groups management modal --- public/src/forum/admin/groups.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js index 970822fa73..811bc3c17b 100644 --- a/public/src/forum/admin/groups.js +++ b/public/src/forum/admin/groups.js @@ -24,9 +24,9 @@ define(function() { createSubmitBtn.on('click', function() { var submitObj = { - name: createNameEl.val(), - description: $('#create-group-desc').val() - }, + name: createNameEl.val(), + description: $('#create-group-desc').val() + }, errorEl = $('#create-modal-error'), errorText; @@ -91,8 +91,9 @@ define(function() { groupMembersEl.empty(); for (x = 0; x < numMembers; x++) { var memberIcon = $('
  • ') + .attr('data-uid', groupObj.members[x].uid) .append($('').attr('src', groupObj.members[x].picture)) - .append($('').attr('data-uid', groupObj.members[x].uid).html(groupObj.members[x].username)); + .append($('').html(groupObj.members[x].username)); groupMembersEl.append(memberIcon); } } @@ -152,7 +153,7 @@ define(function() { uid: uid }, function(err, data) { if (!err) { - groupMembersEl.append(userLabel.cloneNode(true)); + groupMembersEl.append(userLabel.clone(true)); } }); } @@ -164,10 +165,6 @@ define(function() { socket.emit('admin.groups.get', gid, function(err, groupObj){ if (!err){ - if (groupObj.name == 'Administrators' && uid == yourid){ - bootbox.alert('You cannot remove yourself from the Administrator Group'); - return; - } bootbox.confirm('Are you sure you want to remove this user?', function(confirm) { if (confirm){ socket.emit('admin.groups.leave', { From 64ee792013d4e4eb65448c78ff737fdd6ea0f1cf Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2014 11:12:28 -0500 Subject: [PATCH 6/7] fixed #1154 --- public/src/forum/admin/categories.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/forum/admin/categories.js b/public/src/forum/admin/categories.js index 2bcc541cd8..455bc17d79 100644 --- a/public/src/forum/admin/categories.js +++ b/public/src/forum/admin/categories.js @@ -303,7 +303,9 @@ define(['uploader'], function(uploader) { } var numResults = results.length, trEl, - resultObj; + resultObj; + + groupsResultsEl.empty(); for(var x = 0; x < numResults; x++) { resultObj = results[x]; From dc8839b63c5244cf48c194b5150ff588990b84d8 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2014 12:47:40 -0500 Subject: [PATCH 7/7] updating validator to 3.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b3e7350f72..083db7f7a0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "rss": "~0.2.0", "prompt": "~0.2.11", "uglify-js": "~2.4.0", - "validator": "~3.2.1", + "validator": "^3.4.0", "cron": "~1.0.1", "semver": "~2.2.1", "string": "~1.7.0",