alphanodes / additional_tags

Redmine Plugin for adding tags functionality to issues and wiki pages.
https://www.redmine.org/plugins/additional_tags
GNU General Public License v2.0
64 stars 27 forks source link

SQL Error #2

Closed chrislockwood closed 3 years ago

chrislockwood commented 3 years ago

This plugin appears to generate a dreaded 500 internal error, the following is thrown when viewing project issues:

Completed 500 Internal Server Error in 4214ms (ActiveRecord: 3408.3ms)

ActionView::Template::Error (TinyTds::Error: Column 'additional_tags.taggings_count' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.: EXEC sp_executesql N'SELECT additional_tags.*, COUNT(DISTINCT additional_taggings.taggable_id) AS count FROM [additional_tags] JOIN additional_taggings ON additional_taggings.tag_id = additional_tags.id JOIN issues ON issues.id = additional_taggings.taggable_id AND additional_taggings.taggable_type = ''Issue'' JOIN projects ON issues.project_id = projects.id JOIN issue_statuses ON issue_statuses.id = issues.status_id WHERE (projects.id = 1) AND (projects.id IN (1)) AND [issue_statuses].[is_closed] = @0 GROUP BY additional_tags.id, additional_tags.name HAVING (COUNT(*) > 0)  ORDER BY additional_tags.name ASC', N'@0 nvarchar(max)', @0 = 0):
    1: - if AdditionalTags.setting?(:active_issue_tags) && \
    2:      User.current.allowed_to?(:view_issue_tags, @project, global: true) && sidebar_tags.present?
    3:   .sidebar-tags
    4:     h3 = l :field_tags
    5:     = render_sidebar_tags

Host: Windows Server 2016 SQL Server: Microsoft SQL Server 2019 Express

Redmine version: 4.1.1.stable Ruby version: 2.6.6-p146 (2020-03-31) [x64-mingw32] Rails version: 5.2.4.2 Environment: production Database adapter: SQLServer

...I also appear unable to add tags when creating new issues.

chrislockwood commented 3 years ago

PR Submitted 554136b