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

Cannot add custom fields to custom user #719

Closed
rfestag opened this issue Oct 29, 2017 · 7 comments
Closed

Cannot add custom fields to custom user #719

rfestag opened this issue Oct 29, 2017 · 7 comments

Comments

@rfestag
Copy link

rfestag commented Oct 29, 2017

I followed the instructions for using a custom user model, and they work fine. Unfortunately, also want to easily add custom fields to my user (managed through Camaleon, vs. migrations), and I want those fields to show up in the profile. Unfortunately, I can't seem to associate fields with my custom user model. If I fall back to the old user model, I can see my new fields (the field group was associated with Users).

How do I get my custom fields to show up as part of my custom user's profile form?

@rfestag
Copy link
Author

rfestag commented Nov 1, 2017

Alright, so no real progress, but I'm kind of confused as to why User is showing up instead of Blogger.

In my config/system.json, I have user_model="Blogger". This appears to work fine throughout the system, as my Blogger class is used for OAuth2 authentication via Devise.

In the custom_fields/form.html.rb, Line 67 implies that the User model that should be used is coming from

PluginRoutes.static_system_info['user_model']

Looking more closely at lib/plugin_routes.rb, it looks like that should come from my settings.json. Which brings us full circle...why does 'User' show up at all instead of 'Blogger' in this list? Is there someplace else where this setting is being overridden when I'm in the admin menu vs. the rest of the application?

@rfestag
Copy link
Author

rfestag commented Nov 1, 2017

So, looking more closely, it looks like that was a recent change. So it isn't in 2.4.4.5, which I currently have installed. Any idea when the next release is expected?

@owen2345
Copy link
Owner

owen2345 commented Nov 1, 2017

delivered the new version! please try again.

@rfestag
Copy link
Author

rfestag commented Nov 2, 2017

That seems to have resolved it. I did run into a strange issue after the update though...I could no longer get to the Media page in the management console. It would complain about can_edit_file not being defined on the user decorate object. I downgraded back to 2.4.4.5 and it started working again.

The weird thing is that I re-installed 2.4.4.6, and didn't see the issue again. Since I can't reproduce it right now, I'll say things are working as expected, but I figured I'd throw this out there in case anyone else ran into it or knew why it would be happening.

Thanks for putting this tool out there. It has made building/customizing a website I'm working on so much easier!

@rfestag
Copy link
Author

rfestag commented Nov 3, 2017

Actually, my test wasn't correct. I ended up continuing to use 2.4.4.5.
There is still the bug described above (can't get to media page)

undefined method `can_edit_file?' for #<CamaleonCms::UserDecorator:0x0000000694a920>

@owen2345
Copy link
Owner

owen2345 commented Nov 6, 2017

Fixed, please use the new version

@rfestag
Copy link
Author

rfestag commented Nov 11, 2017

This works much better. The issue I'm running into now is that I can't delete users from the admin pages (I get an error about there being no blogger_id method). I haven't tried rolling back to see if this is a new regression or it has always been an issue. I can successfully delete users from the console though.

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

3 participants