TypeError: Cannot read property 'table_name' of undefined
weierophinney opened this issue · 3 comments
I am creating REST API using Database Connected and Select table from given DB Adapter.
When I click on button. It will throws following JS Error.
table_name property is not found in javascript so, My Service is not generated based on selected Table.
TypeError: Cannot read property 'table_name' of undefined
at a.e.ok (c22d22af.apigility.js:1)
at 6a8334db.vendor.js:6
at c.on.e (6a8334db.vendor.js:6)
at k.$eval (6a8334db.vendor.js:5)
at k.$apply (6a8334db.vendor.js:5)
at HTMLButtonElement.<anonymous> (6a8334db.vendor.js:6)
at HTMLButtonElement._.event.dispatch (6a8334db.vendor.js:2)
at HTMLButtonElement.q.handle (6a8334db.vendor.js:2)(anonymous function) @ 6a8334db.vendor.js:5(anonymous function) @ 6a8334db.vendor.js:4k.$apply @ 6a8334db.vendor.js:5(anonymous function) @ 6a8334db.vendor.js:6_.event.dispatch @ 6a8334db.vendor.js:2q.handle @ 6a8334db.vendor.js:2
Originally posted by @AshwinParmar at zfcampus/zf-apigility-admin#313
I have tried to resolve this issue, And, I found issue is here:
e.rest.table_name is return undefined
not getting actual selected table name in this variable.
So, I have tried to use e.dbServices[0].table_name
//console.info(e.dbServices[0].table_name);
if (e.dbServices[0].table_name && (e.dbServices = [{
table_name : e.dbServices[0].table_name, //e.rest.table_name,
columns : []
}
]), 0 == e.dbServices.length)
After doing above changes in vendor\zfcampus\zf-apigility-admin-ui\dist\apigility-ui\c22d22af.apigility.js file Rest service Collection and Entity file are generated.
But, get new error fields not generated.
Error: savings field.
PUT http://localhost:8888/apigility/api/module/MyDbAPI/rest/MyDbAPI-V1-Rest-User_login-Controller/input-filter 404 (Not Found)
Originally posted by @AshwinParmar at zfcampus/zf-apigility-admin#313 (comment)
I think this is a duplicate to zfcampus/zf-apigility-admin-ui#74
Originally posted by @anli-xsigns at zfcampus/zf-apigility-admin#313 (comment)
I can confirm this is STILL and issue and has broken Apigility Admin UI for creating DB-Connected REST services at this time. Completely fresh installs using:
git clone https://github.com/zfcampus/zf-apigility-skeleton.git
or
curl -s https://getcomposer.org/installer | php --
or
download zip/tar from https://github.com/zfcampus/zf-apigility-skeleton/releases
followed by (command) if needed
composer install
ALL of the above yield:
TypeError: Cannot read property 'table_name' of undefined
at a.e.ok (http://localhost/myapp/public/apigility-ui/c22d22af.apigility.js:1:6663)
*snip*
in javascript console. This is installing per instructions in zf-apigility-skeleton and/or installing the skeleton instead.
Originally posted by @PipStyles at zfcampus/zf-apigility-admin#313 (comment)