Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weierophinney opened this issue Dec 31, 2019 · 3 comments
Open

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

weierophinney opened this issue Dec 31, 2019 · 3 comments

Comments

@weierophinney
Copy link
Contributor

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

@weierophinney
Copy link
Contributor 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)


Originally posted by @AshwinParmar at zfcampus/zf-apigility-admin#313 (comment)

@weierophinney
Copy link
Contributor Author

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)

@weierophinney
Copy link
Contributor Author

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)

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

No branches or pull requests

1 participant