yogiben / meteor-admin

A complete admin dashboard solution
https://atmospherejs.com/yogiben/admin
GNU General Public License v3.0
827 stars 261 forks source link

"No data available in table" for Users #255

Closed CraigCarey closed 9 years ago

CraigCarey commented 9 years ago

I can't seem to get any data to display in the User table. The Dashboard widget shows that I have 7 users, and I can view the users in my browser console with "Meteor.users.find().fetch()".

When I open the Users view from the dashboard I get an empty table with the message:

"No data available in table"

and in the browser console:

Exception from Tracker recompute function: debug.js:41 TypeError: Cannot read property '0' of undefined at AdminTables.Users.Tabular.Table.columns._.union.render (startup.coffee:58) at jquery.dataTables.min.js:15 at Object.b.fnGetData (jquery.dataTables.min.js:9) at w (jquery.dataTables.min.js:14) at Ia (jquery.dataTables.min.js:21) at I (jquery.dataTables.min.js:13) at ub (jquery.dataTables.min.js:36) at jquery.dataTables.min.js:33 at Template.tabular.rendered.ajaxOptions.ajax (tabular.js:68) at qa (jquery.dataTables.min.js:33)

I have tried all sorts of publications and none, have used the standard schema from aldeed and have tried it without. All of my other Collections are displayed without issue. Please help.

daloev71 commented 9 years ago

Hi, I had the same issue. It was because I was creating an incomplete user (no email) manually using Meteor.users.insert instead of using Accounts.createUser with username, email, password and profile.

CraigCarey commented 9 years ago

That was it, thanks.

morrismukiri commented 9 years ago

It doesn't work when you add facebook users

CraigCarey commented 9 years ago

@morrismukiri, I got around this by adding a dummy email account during the account creation:

Accounts.onCreateUser(function(options, user) {

    if (!user.emails) {
        user.emails = [{address: user.username + "@facebook.user", verified: false}];
    }
}
morrismukiri commented 9 years ago

I did the same, I used the email in facebook profile as the email, but it still didn't work. I also add other info to the user profile. When I remove the facebook users from the users collection, the remaining users appear in the admin

niranjans commented 8 years ago

+1. Not working with Facebook users

morrismukiri commented 8 years ago

I ended up hiding the users collection from admin and adding my own users collection with the fields I needed. The Accounts.onCreateUser does not work with facebook redirect.

jlourenco commented 8 years ago

Here's how i did it:

Accounts.onCreateUser(function(options, user) {
    if (!user.emails) {
        user.emails = [{address: user.services.facebook.email, verified: false}];
    }
    return user;
});