matteodem / meteor-ogno-admin

Extendable, zero-config admin UI for Meteor
26 stars 7 forks source link

No data received after setup #9

Closed zenmatt closed 10 years ago

zenmatt commented 10 years ago

Everything works, I can see all of my collections and their respective fields, but I get no data from Mongo. I cannot add new records either.

matteodem commented 10 years ago

There could be a lot of reasons for it not to work.

  1. Did you use collection2? If not did you use the version with a schema provided? https://github.com/matteodem/meteor-ogno-admin#collection
  2. Can you add items through the command line? If not you might not have set proper allow rules http://docs.meteor.com/#allow
  3. Are you on the latest Meteor Version? (0.8.0)

If it still won't work I'd need a reproducable repository to checkout and have a look at.

zenmatt commented 10 years ago

1 - Yes using collection2. Apologies, thought that was clear as I can see the Collection fields properly and assumed it was recognizing them via schema definition.

2 - Yes, we can add items without problems (this app is already in production).

3 - Yes.

matteodem commented 10 years ago

Okay, yeah than please provide me with a reproducable repository.

zenmatt commented 10 years ago

Unfortunately I can't do that, maybe we can leave this open for a week or two and see if anyone has a similar problem before closing? I'll have some time today and will continue poking around on my end, will update this thread if I can fix it or provide more information.

matteodem commented 10 years ago

Could it be that you only can edit items after refreshing the site? I'll have a closer look at it l8er.

matteodem commented 10 years ago

Can you please mrt update and have a look if it works now?

zenmatt commented 10 years ago

Refreshing doesn't help. I also updated to the latest release, unfortunately that didn't fix it or have any noticeable changes.

praneybehl commented 10 years ago

I can confirm this too. no data! I've just setup and got into the admin panel, its showing all collections and schema fields but not displaying any records. When I try to add something using a form it gets added into the database but not displayed. But you can see that it kinda appears on the screen before being taken off.

I wonder if its something to do with subscribing to the collections' data. I'll see if I could do a screencast.

praneybehl commented 10 years ago

Update: Alright I got the data by adding publish and subscribe rules for the collections as I have the autopublish removed. You may want to add this to the package description :). But I am getting issues with add users collection from here: https://github.com/matteodem/meteor-ogno-admin/issues/4

Can we please reopen this issue.

praneybehl commented 10 years ago

Also I get these warnings when I click on the collection. It has only 1 record :

duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6 duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6 duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6 duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6 duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6

How can this be fixed?

matteodem commented 10 years ago

Hey there, having no subscription and publish rules is a common error. I guess that goes under common MeteorJS knowledge.

Are these errors happening on the client side? I'll be happy to have a reproducable repository. I'm also getting client errors with the example repository (https://github.com/matteodem/meteor-ogno-admin-example.git).

I'll have a closer look at it tonight.

matteodem commented 10 years ago

I fixed some autoform stuff in the last version https://github.com/matteodem/meteor-ogno-admin/commit/ae1c4426b3c171fe47b759574c0cc2c9de0fe205

please try it out.

praneybehl commented 10 years ago

Thanks mate.

But I am still getting the errors:

duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6 duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6

matteodem commented 10 years ago

Seems like the observer gets some documents twice or more. Not sure about that.

matteodem commented 10 years ago

Fixed even more autoform complications. Please try it out, the duplicate id notice is still happening for some reason though.

praneybehl commented 10 years ago

Thanks mate. I'll test now and get back.

praneybehl commented 10 years ago

yes still getting them: duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6 duplicate id undefined in ["PDGqm57iwyFWQvF4W", "One", "Description One", ""2014-04-03T05:17:59.683Z"", "BBS7SWYF2s9LJgsGo", undefined, undefined, undefined] observe_sequence.js:6

matteodem commented 10 years ago

Back to the original problem @zenmatt. Is it still empty with the newest version? 0.3.10

matteodem commented 10 years ago

Please feel free to re-open this issue when you still got the error.

electricjesus commented 10 years ago

Replicated here: https://github.com/electricjesus/meteor-ogno-admin-issue-9

On the frontend, clearly there is data for the collection.. but when you go to /admin you see the section for the collection but there is no data at all.

matteodem commented 10 years ago

The problem was that one wasn't subscribed to the collection in the admin views. Removing the .subscribe statement to the beginning of the Meteor.startup code would fix it.

I added a new waitOn property though which you can use, I'll add a loading screen in near time: https://github.com/matteodem/meteor-ogno-admin#possible-properties-for-views.

OgnoAdmin.config({
    auto : true,
    prefix: '/admin',
    isAllowed : function () {
        var user = Meteor.user();
        if(user) return true; // just allow all users for this app.. not really recommended obviously :)
    },
    homeScreenTemplate : 'manage',
    homeScreenTemplateGuest : 'manage',
    waitOn : function () {
      Meteor.subscribe('cars');
    }
});

Don't forget to update with mrt update. Also fixed some other stuff on the way, thanks to your help.