Defect #17147

Public/private saved queries are not separated anymore

Added by Olivier Houdas over 3 years ago. Updated 9 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:-
Resolution: Affected version:2.5.1

Description

In Issues, Public and Private queries were grouped in two separated sections in 2.3.3.

In 2.4.3 and 2.5.1, they are all grouped under a single place, the Customized reports section.
As this had been done on purpose (see #4908), and I could not find any issue or request for changing it, maybe it is an unwanted change in recent versions?


Related issues

Related to Redmine - Feature #1019: Role based custom queries Closed 2008-04-08
Duplicated by Redmine - Defect #21096: Redmine throughs error like "visibility is not included i... Closed

History

#1 Updated by Olivier Houdas over 3 years ago

This seems to be an upgrade issue. When we create a query visible to "me" only, it does work.
But all queries previously saved as My custom queries have lost their privacy settings after upgrading.
I will dig into my upgrade scripts tomorrow (it might involve some plugins then).

#2 Updated by Olivier Houdas over 3 years ago

It seems that the update script 20130710182539_add_queries_visibility.rb has failed to update the new visibility column with proper values from the is_public column: all values are NULL in our DB.

We are using MS SQL 2008.

#3 Updated by Olivier Houdas over 3 years ago

OK, I found out what is wrong.
The script sets the new queries.visibility column to 2 if is_public was true, but it leaves other rows unchanged.

For an update, MS SQL creates visibility with NULL for existing rows, although the default value for visibility is set to 0.

Consequently, the 20130710182539_add_queries_visibility.rb migration script should be updated (I haven't tested, though) to

class AddQueriesVisibility < ActiveRecord::Migration
def up
add_column :queries, :visibility, :integer, :default => 0
Query.where(:is_public => true).update_all(:visibility => 2)
Query.where(:is_public => false).update_all(:visibility => 0)
remove_column :queries, :is_public
end
def down
add_column :queries, :is_public, :boolean, :default => true, :null => false
Query.where('visibility <> ?', 2).update_all(:is_public => false)
Query.where(:visibility => 2).update_all(:is_public => true)
remove_column :queries, :visibility
end
end

If you face the issue after upgrading, a simple query like:

UPDATE queries SET visibility = 0 WHERE (visibility IS NULL)

will restore private/public display of your users' queries.

#4 Updated by Olivier Houdas over 3 years ago

Note that this also fixes an issue with saved queries, that sometimes we would get the following message:

"visibility n'est pas inclus(e) dans la liste" (French)
"visibility is not included in the list" (English)

#5 Updated by Toshi MARUYAMA over 3 years ago

#6 Updated by Toshi MARUYAMA almost 2 years ago

  • Duplicated by Defect #21096: Redmine throughs error like "visibility is not included in the list" while clicking issues, gantt tabs. added

#7 Updated by Eswaran Arumugam almost 2 years ago

I have followed this this Query
UPDATE queries SET visibility = 0 WHERE (visibility IS NULL)
But nothing happended. My Error thorough's the same. "visibility is not included in the list"

#8 Updated by Ronny . 9 months ago

Same error for me.
I got "•Visibility is not included in the list" message while trying to open an issue list.
I had a look at queries table. Is empty, so nothing would be change by firing above written sql.

Storing a filter solves the problem, bit after deleting the filter, same message again.

Windows Server 2012R2
Sql Server 2016
Installed yesterday and no content (tickets or so on).

Environment:
Redmine version 3.3.2.stable
Ruby version 2.1.7-p400 (2015-08-18) [x64-mingw32]
Rails version 4.2.7.1
Environment production
Database adapter SQLServer
SCM:
Filesystem
Redmine plugins:
no plugin installed

Any idea whats wrong?
Cheers

#9 Updated by Toshi MARUYAMA 9 months ago

  • Related to Defect #24866: SQLServer: Visibility not included in list added

#10 Updated by Toshi MARUYAMA 8 months ago

  • Related to deleted (Defect #24866: SQLServer: Visibility not included in list)

Also available in: Atom PDF