Skip to content

Error while deleting an object #122

@marekrogala

Description

@marekrogala

Hi,

We get a strange error, which looks like an internal error, while deleting and object with Formage.

Here's what I do:

  1. Login to Formage using valid user and password
  2. Choose object type, in our case for example Users
  3. Choose an object, i .e. one of the users
  4. Click delete and confirm
  5. A message "error" with no additional details is displayed (screenshots attached below). Server output is:
[18:16:51] [server] error: TypeError: Cannot read property 'map' of undefined
  at _map (/home/filip/Projects/x/node_modules/formage/node_modules/async/lib/async.js:54:16)
  at _asyncMap (/home/filip/Projects/x/node_modules/formage/node_modules/async/lib/async.js:237:15)
  at Object.map (/home/filip/Projects/x/node_modules/formage/node_modules/async/lib/async.js:219:23)
  at Object.modelConfig.actions.push.func (/home/filip/Projects/x/node_modules/formage/lib/registry.js:220:19)
  at actionDocuments (/home/filip/Projects/x/node_modules/formage/lib/controllers.js:219:40)
  at Layer.handle [as handle_request] (/home/filip/Projects/x/node_modules/formage/node_modules/express/lib/router/layer.js:76:5)
  at next (/home/filip/Projects/x/node_modules/formage/node_modules/express/lib/router/route.js:100:13)
  at afterParseSession (/home/filip/Projects/x/node_modules/formage/lib/controllers.js:531:32)
  at in_the_handler (/home/filip/Projects/x/node_modules/formage/node_modules/mpromise/lib/promise.js:238:18)
  at process._tickCallback (node.js:419:13)

The error occurs for any of the models.

We're stuck with this error and will appreciate your help. How can we eliminate this error?
We have noticed that Formage uses socket.io internally. We have our own socket.io server running on the same machine -- can this be the reason of the problem?

Environment

  1. Mongo server is set up locally on the machine
  2. Formage is set up using:
import formage = require("formage");
import express = require("express");
var options = {
            title: "Admin Panel",
            root: "/admin",
            default_section: "main",
            username: "admin",
            password: "password",
            admin_users_gui: true
};
formage.init(app, express, app.getModels(), options);
// getModels() is our mix-in which returns the models in the app
  1. Example schema:
    var documentSchema = new mongoose.Schema({
    definitionId: { type: Number },
    userName: { type: String, index: true },
    state: { type: Number, enum: [DocumentState.Started, DocumentState.Finished] },
    data: mongoose.Schema.Types.Mixed
    });

Attachments

  1. The "are you sure" question displayed correctly:
    a8974db2-4305-11e4-9949-bdf8b2a255a4
  2. The error message after confirming:
    ab650c3c-4305-11e4-9204-021c6bc2d399

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions