Aldaviva / floorplan

🗺️ Floorplan, seating chart, and employee directory for Blue Jeans.
166 stars 58 forks source link

User being added through Admin page gets "_id" of null #37

Open bdws opened 7 years ago

bdws commented 7 years ago

Apologies for stopping by with another possible bug report.

When adding a new user through the Admin page, everything looks to go through okay. Once you add a second user, however, if you switch over to the floorplan page, you'll see that the first added user is gone. The last created user will still be available, but any user created through the Admin page other than the last one will disappear.

https://prnt.sc/gtc3sw

Looking at the "people" collection in the floorplan database, it looks like users created through the Admin site get a "_id" value of null. Only one object in the collection can have that null "_id", so the older added users disappear.

If I add users manually through the mongo shell, the users get an "_id" value of "ObjectId("stringOfCharacters") and the users persist in the database and on the Admin/Floorplan sites.

For what it's worth, this happens for me on Ubuntu 16.04 and Centos 7.

Not related at all, but a fresh install pops up with broken images and formatting until permissions are sorted on public/styles. Granting rwx to everyone to that directory fixed the issue and allows the page to render successfully. Prior to fixing permissions, an error can be seen accessing all.css. Think LESS may be unable to convert files in that directory with the default permissions.

Aldaviva commented 7 years ago

Interesting, this isn't reproducing on my system. What version of MongoDB are you using? I suspect the semantics of sending { _id: null } may have changed, since I am on a fairly old version of MondoDB.

Aldaviva commented 7 years ago

Thanks for the tip on the directory permissions, I have updated the Readme: 073f3e2b1e754747dd99126aaa4910ffe87de1ec

bdws commented 7 years ago

I was experiencing the issue on MongoDB 3.4.9. I spun up a fresh Centos 7 VM this morning and installed MongoDB 2.6.9 and the issue persists. Newly added users through the Admin page get a "_id: null" attribute.

Re: the directory permissions, the "all users" group needs the permission to write to the folder/files. "chmod" command in the readme looks like it only grants write permission to owner.

FWIW, I used "chmod -R 757 public/styles data/photos" to fix my permissions issue.

Edduard commented 6 years ago

I'm also experiencing this issue on db version v3.4.10. I'm planning to use this repo for a project I'm working on right now. Are you still working on this issue? Will this be resolved soon?

I need to know in order to make a decision whether to use your repo or not.

Aldaviva commented 6 years ago

Hi @SpedsT,

Thanks for looking at this project.

I'm not actively working on this issue right now. I accept pull requests, but I will also understand if you decide to look elsewhere for your floor planning needs.

Thanks, Ben