You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by "linacs (GitHub)" <gi...@apache.org> on 2018/08/27 18:07:08 UTC
[GitHub] [couchdb] linacs opened issue #1583: req missing (_list
function)
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.
## Steps to Reproduce (for bugs)
Go to www.omniscol.com
Enter a school name, go to the next field: It triggers a verification (that the requested domain is not already taken). Sometimes it works. Sometimes it fails (500 answer. With all my backend code in the error field...).
## 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
[ Full content available at: https://github.com/apache/couchdb/issues/1583 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [couchdb] ermouth commented on issue #1583: req missing
(_list function)
Posted by "ermouth (GitHub)" <gi...@apache.org>.
Please see #1544 for solution.
[ Full content available at: https://github.com/apache/couchdb/issues/1583 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [couchdb] wohali commented on issue #1583: req missing
(_list function)
Posted by "wohali (GitHub)" <gi...@apache.org>.
Duplicate of #1544
[ Full content available at: https://github.com/apache/couchdb/issues/1583 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [couchdb] wohali closed issue #1583: req missing (_list
function)
Posted by "wohali (GitHub)" <gi...@apache.org>.
[ issue closed by wohali ]
[ Full content available at: https://github.com/apache/couchdb/issues/1583 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org