milesj / forum

[Deprecated] A CakePHP plugin for forum / bulletin board systems.
MIT License
131 stars 57 forks source link

AccessLevel.id vs AccessLevel.level #39

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi,

I'm not sure if this is an error or just misunderstanding. In the forum 3.2.0-rc4 when I logged in as admin, the AccessLevel model creates this query:

SELECT AccessLevel.id, AccessLevel.title, AccessLevel.level, AccessLevel.isAdmin, AccessLevel.isSuper FROM c0tipmaster.forum_access_levels AS AccessLevel WHERE AccessLevel.id = 10

However, the table forum_access_levels generated with these columns: id (autoincrement) title level isAdmin isSuper

So the IDs are 1,2,3,4 and the levels 1,4,7,10 (10 for admin)... I don't have much experience with cakePHP and the forum seems to work but inside topics it outputs this:

Undefined index: title [APP/Plugin/Forum/View/Helper/CommonHelper.php, line 178]

milesj commented 11 years ago

Can you try with the 3.2.0 version and not the RC version?

milesj commented 11 years ago

So I looked in both models, Access and AccessLevel, and I didn't see any query that resembles that one:

https://github.com/milesj/cake-forum/blob/master/Model/Access.php https://github.com/milesj/cake-forum/blob/master/Model/AccessLevel.php

And heres the code triggered during login:

https://github.com/milesj/cake-forum/blob/master/Controller/Component/ForumToolbarComponent.php#L78

I wonder if Cake's magic is doing something, will look into. I have yet to run into this problem, so have you added anything to the access table that wasn't part of the install?

milesj commented 11 years ago

Is there a specific page this happens on, or all pages?

milesj commented 11 years ago

I did a fresh install with Forum 3.2.0 and Cake 2.3.0 and could not locate that query anywhere. Feel free to bring this up again with more information.