Editor join array fails with server side processing.
Editor join array fails with server side processing.
naspersgasp
Posts: 53Questions: 14Answers: 1
in General
Hi,
Good day.
Looking at using a select dropdown. I had a look at the joinArray example. Seemed straight forward. Unfortunately it does not work with server side processing. The error I get:
Unhandled promise error: [object Promise]Error: select count(`users`.`id`) as `cnt` from `users` as `0` left join `sites` on `sites`.`id` = `users`.`site` - ER_BAD_FIELD_ERROR: Unknown column 'users.id' in 'field list'
stack: Error: ER_BAD_FIELD_ERROR: Unknown column 'users.id' in 'field list'
at Query.Sequence._packetToError (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
at Query.ErrorPacket (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/protocol/Protocol.js:279:23)
at Parser.write (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/Connection.js:103:28)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:261:11)
at Socket.Readable.push (_stream_readable.js:218:10)
at TCP.onread (net.js:581:20)
--------------------
at Protocol._enqueue (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/protocol/Protocol.js:145:48)
at Connection.query (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/mysql/lib/Connection.js:208:25)
at /Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/knex/lib/dialects/mysql/index.js:161:18
at Promise._execute (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/debuggability.js:303:9)
at Promise._resolveFromExecutor (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/promise.js:79:10)
at Client_MySQL._query (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/knex/lib/dialects/mysql/index.js:155:12)
at Client_MySQL.query (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/knex/lib/client.js:206:17)
at Runner.<anonymous> (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/knex/lib/runner.js:155:36)
at Runner.tryCatcher (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/util.js:16:23)
at Runner.query (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/method.js:15:34)
at /Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/knex/lib/runner.js:61:21
at tryCatcher (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/util.js:16:23)
at /Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/using.js:185:26
at tryCatcher (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/thejj/Downloads/Editor-NodeJS-1.7.4/node_modules/bluebird/js/release/promise.js:512:31)
I'll see if I can find the issue, but maybe you can find it much quicker Thanks.
Regards.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
Can you show me both your client-side and server-side code for Editor please?
Thanks,
Allan
Hi,
I'm using the example code so you can test it easily. It is the controllers/joinArray.js and examples/joinArray.html in the Editor-NodeJS-1.7.4 download.
All I did was add the server side option to the joinArray.html file where the table is initialised. Unfortunately I can't seem to find the issue, but what I do know is the SQL bit is incorrect where it says "
users
as0
"?should be
I don't have a debugger setup to step through the nodejs code. I'm sure it is something simple. Thanks.
Regards.
Hi,
Good day.
joinArray.js:
joinArray.html:
I've only included the important bits of joinArray.html. The only difference compared to the example is the server side setting is true.
Regards.
Awesome! Thanks for pointing me in the right direction. I've committed the fix.
Regards,
Allan
Hi,
You are legend! Fixed. Thanks.
Regards.