FIX: Group name with capital letter throws 404 error (#73)

FIX: Group name with capital letter throws 404 error (#73)

diff --git a/assets/javascripts/discourse/templates/group/assignments.hbs b/assets/javascripts/discourse/templates/group/assignments.hbs
index 288e066..32c6c96 100644
--- a/assets/javascripts/discourse/templates/group/assignments.hbs
+++ b/assets/javascripts/discourse/templates/group/assignments.hbs
@@ -1,4 +1,3 @@
-{{log model}}
 <section class="user-secondary-navigation">
     {{#mobile-nav class="activity-nav" desktopClass="action-list activity-list nav-stacked" currentPath=router._router.currentPath}}
       {{#load-more selector=".activity-nav li" action=(action "loadMore")}}
diff --git a/plugin.rb b/plugin.rb
index e219d11..738f849 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -250,7 +250,7 @@ after_initialize do
   add_to_class(:list_controller, :group_topics_assigned) do
     page = (params[:page].to_i || 0).to_i
 
-    group = Group.find_by("LOWER(name) = ?", params[:groupname])
+    group = Group.find_by("name = ?", params[:groupname])
     raise Discourse::NotFound unless group
     raise Discourse::InvalidAccess unless current_user.can_assign?
 

GitHub sha: 43759bd8

This commit appears in #73 which was merged by davidtaylorhq.

I don’t think group names are case sensitive. We should probably call LOWER on the SQL side and .downcase on the Ruby side :wink:

Can we add a spec for this fix?

1 Like