Ok, So I’ve done extensive testing and have a detailed walk through of what is going on so you can see whats happening.
I start by making a new simple query from scratch.
If I hit the execute query or try to reopen it I get this.
And here is the code that is generated:
<%@ LANGUAGE="JSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/dmxConnectLib/dmxConnect.asp" -->
<script runat="server" language="jscript">
require.setBaseUrl('/dmxConnectLib');
var app = require('lib/app');
app.define( //<<<'JSON'
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
}
]
},
"exec": {
"steps": {
"name": "query",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "HitekFab",
"sql": {
"type": "SELECT",
"columns": [
{
"table": "dbo.box_sizes",
"column": "*"
}
],
"params": [],
"table": {
"name": "dbo.box_sizes"
},
"primary": "id",
"joins": [],
"query": "SELECT *\nFROM [dbo.box_sizes]"
}
},
"output": true,
"meta": [
{
"type": "number",
"name": "id"
},
{
"type": "text",
"name": "boxlength"
},
{
"type": "text",
"name": "boxwidth"
},
{
"type": "text",
"name": "boxheight"
},
{
"type": "text",
"name": "boxprice"
}
],
"outputType": "array"
}
}
}
//JSON
);
</script>
Ok so if I now go in and manually edit the code to this (removing column names and adding schema name)
Here is the actual code:
<%@ LANGUAGE="JSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/dmxConnectLib/dmxConnect.asp" -->
<script runat="server" language="jscript">
require.setBaseUrl('/dmxConnectLib');
var app = require('lib/app');
app.define( //<<<'JSON'
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
}
]
},
"exec": {
"steps": {
"name": "query",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "HitekFab",
"sql": {
"type": "SELECT",
"columns": [],
"params": [],
"table": {
"name": "box_sizes",
"schema": "dbo"
},
"primary": "id",
"joins": [],
"query": "SELECT *\nFROM [dbo.box_sizes]"
}
},
"output": true,
"meta": [
{
"type": "number",
"name": "id"
},
{
"type": "text",
"name": "boxlength"
},
{
"type": "text",
"name": "boxwidth"
},
{
"type": "text",
"name": "boxheight"
},
{
"type": "text",
"name": "boxprice"
}
],
"outputType": "array"
}
}
}
//JSON
);
</script>
And I am able to reopen the query now, and also able to run execute the query
So now I go back and add each of the columns and now I get the cannot read properties of undefined .
And here is the code after I add the column names
<%@ LANGUAGE="JSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/dmxConnectLib/dmxConnect.asp" -->
<script runat="server" language="jscript">
require.setBaseUrl('/dmxConnectLib');
var app = require('lib/app');
app.define( //<<<'JSON'
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
}
]
},
"exec": {
"steps": {
"name": "query",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "HitekFab",
"sql": {
"type": "SELECT",
"columns": [
{
"table": "box_sizes",
"column": "id",
"schema": "dbo"
},
{
"table": "box_sizes",
"column": "boxlength",
"schema": "dbo"
},
{
"table": "box_sizes",
"column": "boxwidth",
"schema": "dbo"
},
{
"table": "box_sizes",
"column": "boxheight",
"schema": "dbo"
},
{
"table": "box_sizes",
"column": "boxprice",
"schema": "dbo"
}
],
"params": [],
"table": {
"name": "box_sizes",
"schema": "dbo"
},
"primary": "id",
"joins": [],
"query": "SELECT id, boxlength, boxwidth, boxheight, boxprice\nFROM dbo.box_sizes"
}
},
"output": true,
"meta": [
{
"type": "number",
"name": "id"
},
{
"type": "text",
"name": "boxlength"
},
{
"type": "text",
"name": "boxwidth"
},
{
"type": "text",
"name": "boxheight"
},
{
"type": "text",
"name": "boxprice"
}
],
"outputType": "array"
}
}
}
//JSON
);
</script>
So this is the best I can do to show what is going on? Please help it has to be something small that’s rewriting wrong or something. This is an emergency at this point. I’ll get up at 3am my time if I have to troubleshoot this on your time zone? @patrick @george @Teodor
And like I said before 5.2.3 was working for me. In experimental mode in that version it wasn’t. so guessing right around in there is where the problem started happening.