Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

TypeError: Cannot read property 'table_name' of undefined #313

Open
AshwinParmar opened this issue Aug 14, 2015 · 4 comments
Open

TypeError: Cannot read property 'table_name' of undefined #313

AshwinParmar opened this issue Aug 14, 2015 · 4 comments

Comments

@AshwinParmar
Copy link

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
@AshwinParmar
Copy link
Author

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)

@anli-xsigns
Copy link

I think this is a duplicate to zfcampus/zf-apigility-admin-ui#74

@PipStyles
Copy link

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.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-admin; a new issue has been opened at laminas-api-tools/api-tools-admin#29.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants