Project

General

Profile

Actions

Defect #17147

open

Public/private saved queries are not separated anymore

Added by Olivier Houdas almost 10 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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 queriesClosedJean-Philippe Lang2008-04-08

Actions
Has duplicate Redmine - Defect #21096: Redmine throughs error like "visibility is not included in the list" while clicking issues, gantt tabs. Closed

Actions
Actions #1

Updated by Olivier Houdas almost 10 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).

Actions #2

Updated by Olivier Houdas almost 10 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.

Actions #3

Updated by Olivier Houdas almost 10 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.

Actions #4

Updated by Olivier Houdas almost 10 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)
Actions #5

Updated by Toshi MARUYAMA almost 10 years ago

Actions #6

Updated by Toshi MARUYAMA over 8 years ago

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

Updated by Eswaran Arumugam over 8 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"

Actions #8

Updated by Ronny . over 7 years 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

Actions #9

Updated by Toshi MARUYAMA over 7 years ago

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

Updated by Toshi MARUYAMA about 7 years ago

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

Also available in: Atom PDF