diff --git a/js/apps/system/users/setup.js b/js/apps/system/users/setup.js index 84d9dc1128..707341ae48 100644 --- a/js/apps/system/users/setup.js +++ b/js/apps/system/users/setup.js @@ -7,4 +7,4 @@ if (db._collection(usersName) === null) { db._create(usersName, {isSystem: true}); } -}()); \ No newline at end of file +}()); diff --git a/js/server/modules/org/arangodb/foxx/manager.js b/js/server/modules/org/arangodb/foxx/manager.js index 90d943a3db..8b344047e1 100644 --- a/js/server/modules/org/arangodb/foxx/manager.js +++ b/js/server/modules/org/arangodb/foxx/manager.js @@ -194,12 +194,15 @@ function extendContext (context, app, root) { var cp = context.collectionPrefix; var cname = ""; - if (cp !== "") { + if (cp === "_") { + cname = "_"; + } + else if (cp !== "") { cname = cp + "_"; } context.collectionName = function (name) { - var replaced = (cname + name).replace(/[^a-zA-Z0-9]/g, '_').replace(/(^_+|_+$)/g, '').substr(0, 64); + var replaced = cname + name.replace(/[^a-zA-Z0-9]/g, '_').replace(/(^_+|_+$)/g, '').substr(0, 64); if (replaced.length === 0) { throw new Error("Cannot derive collection name from '" + name + "'");