Thursday, January 3, 2013

Re: Displayfield from plugin not used from main app

Thanks for quick reply. I will take another look at the plugin views, but I am not sure that is where I need to change things.

I'm calling the user_id hoping to get the displayField from outside of the plugin from a view from my main app.



On Thursday, January 3, 2013 5:22:34 PM UTC-6, cricket wrote:
On Thu, Jan 3, 2013 at 5:14 PM, mk <mkla...@gmail.com> wrote:
> Hi,
>
> I'm using the CakeDC Users plugin and have it working, however when I access
> it from a View in the main app, it is showing only the user id rather than
> the displayfield =
> 'username';
>
> Plugin User Model contains
>     public $displayField = 'username';

Does your users table have a 'username' column?

> Main App View (add.ctp) Contains
>     echo $this->Form->input('user_id');

That looks a little odd. I would expect that the id would be
auto-generated and that, minimally, there would be a username input.

I haven't used this plugin, btw.

ok, I've just looked at the schema for this. The user_id column is in
the user_details table. It's the foreign key pointing to the users
table.

Take a look at the views that come with the plugin. I think that
perhaps you've tried modifying things and taken a wrong turn
somewhere.

> View displays user_id rather than username.
>
> Any ideas on what needs to be done to get this to show displayfield
> correctly? I tried adding a recursive=2 to the add action for the
> correspoiding view but that did not work...

Changing recursive would have no effect.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: