Tuesday, January 4, 2011

Re: Comments plugins

Just before line 29 (where the error is firing) type:

debug($comment);
die(debug($userModel));

This will print out the contents of the $comment variable and also the name of the model being used for users. It is possible that $comment is empty, in which case there would be no array node where the user should be, and therefore the error fires.

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 4 Jan 2011, at 15:20, John Maxim wrote:

> Hi Jeremy,
>
> I don't know how to debug $comment, actually I am able to post new
> comment from the posts/ page, no error or whatsoever.
>
> After the comment is added and when I view the comment in view.ctp
> here comes the error above the comment which was posted justnow. The
> rest of the page is just loaded like usual.
>
> Can you tell me how to debug my $comment ?
>
> The userModel is basically this line I added according to the
> instruction cakedc comments plugin page:
>
> public $components = array('Comments.Comments' =>
> array('userModelClass' => 'Users.User'));
>
> it is to be placed in any of the controller which you want comment
> working, I chose Posts controller so it goes in my posts controller.
>
> It follows by $this->passedArgs['comment_view_type'] = 'flat';
>
> in beforeFilter function..
>
> But I don't know what us $userModel, Jeremy maybe you could point out
> the missing part I have in this code ?
>
> Thanks..
>
>
> On Jan 4, 11:08 pm, Jeremy Burns | Class Outfit
> <jeremybu...@classoutfit.com> wrote:
>> What happens when you debug out $comment? And what is $userModel?
>>
>> Jeremy Burns
>> Class Outfit
>>
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>>
>> On 4 Jan 2011, at 15:06, John Maxim wrote:
>>
>>> Line 29:
>>
>>> Line 29 is $_userLink = $comment[$userModel]['username'];
>>
>>> the above is the line of code from the error message posted earlier.
>>
>>> On Jan 4, 10:20 pm, John Maxim <goog...@gmail.com> wrote:
>>>> There is a username column in users table.
>>
>>>> The support from the cakedc tickets are almost all left unanswered..
>>
>>>> I am losing hope with this plugin.
>>
>>>> not one response about this in irc..
>>
>>>> strangely something is wrong with user's ID or name; found a link
>>>> here:http://www.jonathansibley.com/cakephp/comments-plugin-by-cakedc-getti...
>>
>>>> but doesn't help even after adding public $displayField =
>>>> 'username';
>>
>>>> in users controller..
>>
>>>> I suspect there is displayField function missing ?
>>
>>>> On Jan 4, 9:49 pm, Joshua Muheim <psybea...@gmail.com> wrote:
>>
>>>>> I don't know this plugin, but this sounds to me like your database
>>>>> tables does not have a username column...?
>>
>>>>> On Tue, Jan 4, 2011 at 2:20 PM, John Maxim <goog...@gmail.com> wrote:
>>>>>> Hi people,
>>
>>>>>> I installed this :
>>
>>>>>> https://github.com/CakeDC/comments
>>
>>>>>> I am having problem with:
>>>>>> Notice (8): Undefined index: username [APP\plugins\comments\views
>>>>>> \elements\comments\flat\item.ctp, line 29]
>>
>>>>>> when load my view page..
>>
>>>>>> regards,
>>>>>> Maxim
>>
>>>>>> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers with their CakePHP related questions.
>>
>>>>>> 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 For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
>>
>>> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>>
>>> 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 For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> 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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: