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:
parent
ea548f0df3
commit
44088e0b3c
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue