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
users not checked if nil #6
Comments
Is there a situation that "@users" is null? |
could you check? |
I checked that the error is gone now, but why i don't see any users to set votes for? |
There are two queries executed SELECT * FROM Above queries can only find me (logged in user) because of users SELECT * FROM Above qeury only finds group i (logged in user) belong to. Where is a query that shall build the user list? |
1- In the list should display all project members. 2 - The query is from association between Project and User. "@project.users" |
The queries must be wrong because users.id=3 can only be one user! The list is empty but there are mor than 30 members you can see in project overview and in projects settings too. |
This is the query: @users = @project.users.collect {|user| {'id' => user.id, 'login' => user.login, 'fullname' => user.name(:firstname_lastname), 'votes' => user.polls_votes_project(@project.id)? user.polls_votes_project(@project.id) : '--'}} |
Processing PollsController#index (for 172.16.104.6 at 2012-02-10 17:34:58) [GET]
I, [2012-02-10T17:34:58.540528 #11109] INFO -- : Parameters: {"project_id"=>"spielwiese", "action"=>"index", "controller"=>"polls"}
D, [2012-02-10T17:34:58.542652 #11109] DEBUG -- : �[4;36;1mSQL (1.4ms)�[0m �[0;1mSELECT max(
settings
.updated_on) AS max_updated_on FROMsettings
�[0mD, [2012-02-10T17:34:58.544404 #11109] DEBUG -- : �[4;35;1mUser Load (1.0ms)�[0m �[0mSELECT * FROM
users
WHERE (users
.id
= 3) AND (users.status = 1) AND ( (users
.type
= 'User' ORusers
.type
= 'AnonymousUser' ) ) �[0mD, [2012-02-10T17:34:58.545424 #11109] DEBUG -- : �[4;36;1mProject Load (0.3ms)�[0m �[0;1mSELECT * FROM
projects
WHERE (projects
.identifier
= 'spielwiese') LIMIT 1�[0mD, [2012-02-10T17:34:58.546406 #11109] DEBUG -- : �[4;35;1mEnabledModule Load (0.5ms)�[0m �[0mSELECT name FROM
enabled_modules
WHERE (enabled_modules
.project_id = 105) �[0mD, [2012-02-10T17:34:58.559199 #11109] DEBUG -- : �[4;36;1mIssueStatus Load (6.4ms)�[0m �[0;1mSELECT * FROM
issue_statuses
ORDER BY position�[0mD, [2012-02-10T17:34:58.560408 #11109] DEBUG -- : �[4;35;1mEligibleStatus Load (0.9ms)�[0m �[0mSELECT * FROM
eligible_statuses
�[0mD, [2012-02-10T17:34:58.560745 #11109] DEBUG -- : �[4;36;1mCACHE (0.0ms)�[0m �[0;1mSELECT * FROM
projects
WHERE (projects
.identifier
= 'spielwiese') LIMIT 1�[0mD, [2012-02-10T17:34:58.561148 #11109] DEBUG -- : �[4;35;1mCACHE (0.0ms)�[0m �[0mSELECT name FROM
enabled_modules
WHERE (enabled_modules
.project_id = 105) �[0mD, [2012-02-10T17:34:58.576189 #11109] DEBUG -- : �[4;36;1mVotingPoll Load (8.8ms)�[0m �[0;1mSELECT * FROM
voting_polls
WHERE (voting_polls
.project_id
= 105) �[0mI, [2012-02-10T17:34:58.578292 #11109] INFO -- : Rendering template within layouts/base
I, [2012-02-10T17:34:58.578351 #11109] INFO -- : Rendering polls/index
D, [2012-02-10T17:34:58.584540 #11109] DEBUG -- : Rendered polls/_config (3.2ms)
F, [2012-02-10T17:34:58.614064 #11109] FATAL -- :
ActionView::TemplateError (undefined method `empty?' for nil:NilClass) on line #15 of vendor/plugins/redmine_issues_poll/app/views/polls/_members.rhtml:
12: See the License for the specific language governing permissions and
13: limitations under the License. -->
14:
15: <% if @users.empty? %>
16:
17: <%= l(:label_no_data) %>
18:
I, [2012-02-10T17:34:58.629631 #11109] INFO -- : Rendering /opt/redmine-1.2.1d3/public/500.html (500 Internal Server Error)
The text was updated successfully, but these errors were encountered: