Skip to content

req missing (_list function) #1583

@linacs

Description

@linacs

Req is missing inside a _list function

Expected Behavior

I'm using "req" inside a function stored in _list.
It worked perfectly until recently (and I cannot reproduce locally with an older version of CouchDB).

Current Behavior

error: "render_error"
reason:"function raised error: (new TypeError("req.query is undefined", "lists.schools", 5))

Here is school.js inside _list:

function(head, req) {

    req = req || {};   // odd bug
    req.query = req.query || {};   // odd bug
    var callback = req.query.callback || null;

I've added the two first lines hoping it will fix the bug, but it has not. :(
req.query comes from a rewrite.

    { "from": "portal/api/guest/schools/:schoolid", "to": "_list/schools/allschools",
                "query": { "callback": "os_guest_domaintest", "access": "all" } },

Possible Solution

No idea.

Your Environment

  • Version used: 2.1.2 and 2.2 (but not 2.1.1)
  • Browser Name and version: Chrome
  • Operating System and version (desktop or mobile): MacOS X

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