show next/prev buttons on module wiki pages for unlogged users

even if a user isn't logged the next/prev buttons
should still show up... they do everywhere else

fixes #3929

Change-Id: I8415b17bcb00c3c8b5b845919f892ac13dc3c58e
Reviewed-on: https://gerrit.instructure.com/2470
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
This commit is contained in:
Brian Whitmer 2011-02-28 16:04:25 -07:00
parent ea548f0df3
commit 44088e0b3c
1 changed files with 4 additions and 4 deletions

View File

@ -170,13 +170,13 @@ class WikiPage < ActiveRecord::Base
end
def context_module_tag_for(context, user)
return nil unless user
@tags ||= {}
user_id = user ? user.id : 0
# for wiki_pages, context_module_association_id should be the wiki_namespace_id to use
if context
@tags[user.id] ||= self.context_module_tags.find_by_context_id_and_context_type(context.id, context.class.to_s) #module_association_id(current_namespace(user).id)
else
@tags[user.id] ||= self.context_module_tags.find_by_context_module_association_id(current_namespace(user).id)
@tags[user_id] ||= self.context_module_tags.find_by_context_id_and_context_type(context.id, context.class.to_s) #module_association_id(current_namespace(user).id)
elsif user
@tags[user_id] ||= self.context_module_tags.find_by_context_module_association_id(current_namespace(user).id)
end
end