Open livvyjeffs opened 9 years ago
Hey, houston:admin should usually work alright. Do you have your code somewhere that I can inspect to check what the problem could be. Or at least paste the kAdminConfig
and kAccountsAdminConfig
objects somewhere?
Hm, in my Meteor console I get this error:
Exception from sub kAdminSubscribe id hFQzvFkwY65jE4bsE TypeError: Cannot read property 'children' of undefined
And since it doesn't work in both Houston and Kaoskeya, makes me think I haven't hooked up or published my User database correctly?
My kAdminConfig
and kAccountsAdminConfig
are exactly as shown in the example, and they are in the common code at lib/environment.js:
kAdminConfig = {
name: 'Your Admin',
collections: {
"Meteor.users": {
verbose: "Users",
templates: {
"crud": { name: 'kAccountsAdminFluid' },
"new": { name: 'yourCustomAdminCreateModule' }
}
},
}
}
kAccountsAdminConfig = {
tableColumns: [
{ label: 'Name', name: 'getName()' },
{ label: 'Roles', name: 'getRoles()' },
{ label: 'Account Type', name: 'getAccountType()' },
{ label: 'Email', name: 'getEmail()' },
]
}
The publish is automatically done, both in Houston and kaoskeya:admin.
You have added accounts-password, etc right?
In kaoskeya:admin, when you have selected Users
from the dropdown, do you see empty rows or no rows at all?
Try running Meteor.users.find().fetch() in your console and see if you can see all the users there. Also, in your database, try running db.users.find().count(), how many users do you see?
This should help us to get to a fix.
As for the Exception, I will look into this shortly.
I am getting the same error. Thought it might help if you had some more info. When I select Users, I get this error in the Console:
Error: Exception in template helper: TypeError: self[col.name.substr(...)] is not a function at http://localhost:3000/packages/kaoskeya_accounts-autoform-admin.js?a0ff4ec3bdc02e5e6ff2aa22a0a60d8607cccf05:218:61 at Array.map (native) at Function..map..collect (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:174:56) at Template.kAccountsAdminPanel.helpers.getAttr (http://localhost:3000/packages/kaoskeya_accounts-autoform-admin.js?a0ff4ec3bdc02e5e6ff2aa22a0a60d8607cccf05:216:12) at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2880:16 at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:1651:16 at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2928:66 at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:3476:12) at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2927:27 at Spacebars.call (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:172:18)
Problem might be related to roles. When I click on View I see the data for User fields. However, I also get this error in Console:
Error: Cannot read property 'top' of undefined
TypeError: Cannot read property 'top' of undefined
at Template.kAdminPanel.events.click .action (k_admin.js:195)
at template.js:463
at Function.Template._withTemplateInstanceFunc (template.js:437)
at null.
Before: 316109ms (diff: 316109ms) at usePostMessage (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:381:12) at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:410:3 at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:415:4 at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:1086:3
When I click on Roles, I do not see the data for roles. However, I also get this error in Console:
Error: Cannot read property 'top' of undefined
TypeError: Cannot read property 'top' of undefined
at Template.kAdminPanel.events.click .action (k_admin.js:195)
at template.js:463
at Function.Template._withTemplateInstanceFunc (template.js:437)
at null.
Before: 560404ms (diff: 560404ms) at usePostMessage (setimmediate.js:111) at setimmediate.js:140 at meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:415 at meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:1086 reporters.js?1437421748148:67 Error: Error: {{#each}} currently only accepts arrays, cursors or falsey values. at badSequenceError (http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:179:10) at http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:144:17 at Object.Tracker.nonreactive (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:593:12) at http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:121:15 at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:327:36) at new Tracker.Computation (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:243:10) at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:566:11) at Object.ObserveSequence.observe (http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:118:31) at null.
(http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2678:43) at fireCallbacks (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:1941:16) Before: 560404ms (diff: 560404ms) at usePostMessage (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:381:12) at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:410:3 at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:415:4 at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:1086:3 reporters.js?1437421748148:67 Error: Exception in template helper: TypeError: self[col.name.substr(...)] is not a function at http://localhost:3000/packages/kaoskeya_accounts-autoform-admin.js?a0ff4ec3bdc02e5e6ff2aa22a0a60d8607cccf05:218:61 at Array.map (native) at Function..map..collect (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:174:56) at Template.kAccountsAdminPanel.helpers.getAttr (http://localhost:3000/packages/kaoskeya_accounts-autoform-admin.js?a0ff4ec3bdc02e5e6ff2aa22a0a60d8607cccf05:216:12) at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2880:16 at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:1651:16 at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2928:66 at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:3476:12) at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2927:27 at Spacebars.call (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:172:18)
Before: 560404ms (diff: 560404ms) at usePostMessage (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:381:12) at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:410:3 at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:415:4 at http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:1086:3
Hey, the Error: Cannot read property 'top' of undefined
error was due to a bug in meteor-admin, I've just pushed an update. Could you update your project package? The bug should hopefully be gone.
As for TypeError: self[col.name.substr(...)] is not a function
, could you please put your kAccountsAdminConfig
object here so I can check what the problem could be? Seems like the helpers that you have specified are not defined.
E.g:
{ label: 'Roles', name: 'getRoles()' },
would require the collection helper getRoles
created as given below:
Meteor.users.helpers({
getRoles: function() {
if( this.roles )
return this.roles.toString();
else
return "";
},
})
Error: Cannot read property 'top' of undefined is fixed. Thanks.
kAdminConfig = { name: 'Your Admin', collections: { "Meteor.users": { verbose: "Users", templates: { "crud": { name: 'kAccountsAdminFluid' } } } } }
kAccountsAdminConfig = { tableColumns: [ { label: 'Roles', name: 'getRoles()' } ] }
Added below to lib folder:
Meteor.users.helpers({ getRoles: function() { if( this.roles ) { return this.roles.toString(); } else { return ""; } } })
Now, am getting this error:
W20150721-11:54:30.198(-5)? (STDERR)
W20150721-11:54:30.198(-5)? (STDERR) /Users/dougserfass/.meteor/packages/meteor-tool/.1.1.3.ny18gk++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/nodemodules/fibers/future.js:245
W20150721-11:54:30.198(-5)? (STDERR) throw(ex);
W20150721-11:54:30.198(-5)? (STDERR) ^
W20150721-11:54:30.201(-5)? (STDERR) Error: [Can't apply helpers to 'users' a transform function already exists!]
W20150721-11:54:30.201(-5)? (STDERR) at [object Object].Mongo.Collection.helpers (packages/dburles:collection-helpers/collection-helpers.js:5:1)
W20150721-11:54:30.201(-5)? (STDERR) at app/lib/helpers/admin.js:1:49
W20150721-11:54:30.201(-5)? (STDERR) at app/lib/helpers/admin.js:11:3
W20150721-11:54:30.201(-5)? (STDERR) at /Users/dougserfass/teamput/app/.meteor/local/build/programs/server/boot.js:222:10
W20150721-11:54:30.201(-5)? (STDERR) at Array.forEach (native)
W20150721-11:54:30.201(-5)? (STDERR) at Function..each._.forEach (/Users/dougserfass/.meteor/packages/meteor-tool/.1.1.3.ny18gk++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150721-11:54:30.201(-5)? (STDERR) at /Users/dougserfass/teamput/app/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
Hey, as the error message states:
Error: [Can't apply helpers to 'users' a transform function already exists!]
You have already defined Meteor.users.helpers
elsewhere in your code. Could you add the getRoles
helper to that and retry?
have not defined Meteor.users.helpers elsewhere in my code is there a way to debug to find the location where dburles:collection-helpers thinks this transform already exists?
could it be in another package?
Do you have this project code somewhere online on a repo maybe? Or is it a private project, if so could you paste the contents of you app/lib/helpers/admin.js
file?
I tried creating multiple Meteor.users.helpers
in a project and it worked just file, so the problem has to be elsewhere.
Meteor.users.helpers({ getRoles: function() { if( this.roles ) { return this.roles.toString(); } else { return ""; } } })
I am unable to figure out what could be wrong :disappointed: Is there anyway you can replicate the issue on a smaller new project that you can put on git that I can check?
modified
kAccountsAdminConfig = { tableColumns: [ { label: 'Roles', name: 'roles' } ] }
now, i get
[object Object] in your table, but i also get
Exception from sub kAdminSubscribe id GzAyH5fCxZgrmQRff TypeError: Cannot read property 'children' of undefined
ok, this works, and I get the Id in the table:
kAdminConfig = { name: 'Your Admin', collections: { "Meteor.users": { verbose: "Users", templates: { "crud": { name: 'kAccountsAdminFluid' } } } } }
kAccountsAdminConfig = { tableColumns: [ { label: 'Id', name: '_id' } ] }
however, when i click on the Roles button i get this error in the js console:
Error: Error: {{#each}} currently only accepts arrays, cursors or falsey values.
at badSequenceError (http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:179:10)
at http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:144:17
at Object.Tracker.nonreactive (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:593:12)
at http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:121:15
at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:327:36)
at new Tracker.Computation (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:243:10)
at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:566:11)
at Object.ObserveSequence.observe (http://localhost:3000/packages/observe-sequence.js?0532a9dd76dd78f543eb4d79a1e429df186d8bde:118:31)
at null.
Could you give the output of meteor list
in your terminal from your project folder.
meteor list
255kb:meteor-status 1.2.0* Meteor Status automatically alerts u...
3stack:presence 1.0.3 Track who' online on your app, and w...
accounts-base 1.2.0 A user account system
accounts-facebook 1.0.4 Login service for Facebook accounts
accounts-google 1.0.4 Login service for Google accounts
accounts-password 1.1.1 Password support for accounts
alanning:roles 1.2.13 Role-based authorization
aldeed:autoform 4.2.2* Easily create forms with automatic i...
aldeed:collection2 2.3.3 Automatic validation of insert and u...
aldeed:template-extension 3.4.3 Adds template features currently mis...
avatar 0.7.6+ Consolidated user avatar template (t...
base-model 0.1.3+ A model for all other models to inhe...
bootstrap-contextmenu 0.0.1+ A meter package wrapper to https://g...
canvas-roles 0.0.0+
cfs:graphicsmagick 0.0.18 Adds gm
to scope with the ability...
circular-menu 0.0.0+
dburles:collection-helpers 1.0.3 Transform your collections with help...
dburles:jquery-tinysort 0.5.5 TinySort, a small and simple jQuery ...
dsyko:meteor-node-csv 0.3.7 node-csv npm packaged for meteor.
email 1.0.6 Send email messages
fds:keycodes 1.0.2 Names for event key codes
force-ssl 1.0.4 Require this application to use HTTPS
fortawesome:fontawesome 4.3.0 Font Awesome (official): 500+ scalab...
hammer:hammer 2.0.4_2 Hammer.js (official) - multi-touch...
html-parser 0.0.0+
html2canvas 0.0.0+
http 1.1.0 Make HTTP calls to remote servers
intercom-local 1.2.4+ Intercom.io basic integration (uses ...
iron:router 1.0.7* Routing specifically designed for Me...
jag:pince 0.0.6* A logger for Meteor inspired by log4...
jquery 1.11.32 Manipulate the DOM using CSS sele...
jstree 3.1.0+ Package wrapper for jstree plugin.
kaoskeya:accounts-autoform-admin 0.0.1 Manage users module for kaoskeya:adm...
kaoskeya:admin 0.2.5 Simple autoform based admin that int...
matb33:collection-hooks 0.7.13 Extends Mongo.Collection with befor...
matdutour:outdated-browser 0.1.1 Detects outdated browsers and advise...
meteor-platform 1.2.2 Include a standard set of Meteor pac...
meteorhacks:cluster 1.6.4* Clustering solution for Meteor with ...
meteorhacks:kadira 2.20.3* Performance Monitoring for Meteor
meteorhacks:kadira-profiler 1.1.0* CPU Profiler for Kadira
meteorhacks:npm 1.3.0 Use npm modules with your Meteor App
meteorhacks:zones 1.4.0* Zone.Js integration for meteor
mirageglobe:html5shivcdn 1.2.3 Latest version html5shiv loaded via ...
mizzao:jquery-ui 1.11.2 Simple lightweight pull-in for jQue...
momentjs:moment 2.10.3 Moment.js (official): parse, valida...
mrt:cron 0.0.1 Simple meteor.cron
npm-container 1.0.0+ Contains all your npm dependencies
ongoworks:security 1.1.0* Logical security for client-originat...
pascoual:pdfkit 1.0.5 PDFKit, the PDF generation library
pauli:accounts-linkedin 1.1.2 Accounts service for LinkedIn accounts
pfafman:multer 0.1.0 Add Multer to meteor
plotter 0.0.0+
redactor 10.0.5+ Redactor WYSIWYG html editor.
reywood:iron-router-ga 0.6.0 Google analytics (universal edition)...
s3-server 0.0.0+ Upload files to S3. Allows use of Kn...
sacha:spin 2.0.4* Simple spinner package for Meteor
selection-box 0.0.0+
selectionchange-polyfill 0.0.0+
sergeyt:livequery 1.3.7 Live Query utilizes the power of jQu...
server-time 0.1.0+ Package to compensate for client/ser...
service-configuration 1.0.4 Manage the configuration for third-p...
socialize:messaging 0.2.1+ A social messaging package LOCAL
tmeasday:html5-history-api 4.1.2 HTML5 History API expansion for brow...
twbs:bootstrap 3.3.4* The most popular front-end framework...
underscore 1.0.3 Collection of small helpers: .map, ...
user-model 0.1.2+ A social user package
useraccounts:bootstrap 1.9.1* Accounts Templates styled for Twitte...
uzumaxy:prevent-backspace 0.0.1 Prevents the backspace from navigati...
voidale:better-emails 0.0.1+ Send Better Emails
voidale:bootstrap-alerts 0.3.5 Bootstrap styled alerts with halflings
voidale:bootstrap-dynamic-modal 0.0.1+ Simple shortcut of bootstrap 3 modals.
voidale:meteor-notification 0.0.2+ Adds notification functionality
voidale:minimap 0.0.1+ Wrapper for mgMiniMap Jquery minimap...
voidale:nano-scroller 0.8.6+ A wrapper for nano Custom Scrollbar.
voidale:offcanvas-chat 0.0.1+ Simple off canvas chat
voidale:stripe-subscriptions 0.0.1+ Complete package for Stripe Subscipt...
webshot 0.0.0+ Webshot - NPM Screenshot Library usi...
zimme:iron-router-active 1.0.4* Active route/path template helpers f...
any update on this issue based on the output from my meteor list? thanks
Hey, no luck. I'm going to have to look at some code to figure out what is happening. Would you have the repo somewhere that I could access?
working with the owner of the repo to grant you access
the owner of the repo has granted you collaborator access to 14falcons/teamput
also, as it is his package that is throwing the exception, dburles is also looking at the issue
Hey, I'll check it out and let you know whats happening.
great! thanks! From: Karthikeyan notifications@github.com To: kaoskeya/meteor-accounts-autoform-admin meteor-accounts-autoform-admin@noreply.github.com Cc: dougserfass dougserfass@yahoo.com Sent: Tuesday, July 28, 2015 1:06 AM Subject: Re: [meteor-accounts-autoform-admin] This pulls 0 users (#1)
Hey, I'll check it out and let you know whats happening.— Reply to this email directly or view it on GitHub.
find anything?
kaoskeya, the owner of the app has asked me to see if you have any update on this problem? our team really likes the way your packages will integrate with our app and would like to go forward with your packages if all goes well, your packages would be integrated very soon into a commercial meteor product thanks doug
Hey, I've been a little busy. I'll look into this tonight and give you guys an update.
Any help on getting it to connect with a collection or advice on how to publish? I've been trying a few different admin solutions, houston:admin for some reason does not connect to my User collection, but it connects to all my other collections.