Project

General

Profile

Issues visible accross all project?!

Added by Morten MacFly over 11 years ago

Environment:
Redmine version 2.3.1.stable
Ruby version 1.9.3 (i386-mingw32)
Rails version 3.2.13
Environment production
Database adapter Mysql2
Redmine plugins:
no plugin installed

I've created 5 projects without dependencies between them within a redmine server.
Now when I log into one project and create a new issues it becomes visible in another project's issue list, too.

If I disable the option "Display sub-projects issues on main projects by default" they are gone. But the problem is that these 5 are all main projects (w/o sub-projects). Nevertheless 2 of these projects have sub-projects, so I cannot disable this option w/o loosing the functionality I need here.

How do I need to setup the project / redmine option so that the 5 main projects only see issues assiging within the main projects, but the two main projects with sub-projects see the issues of the very single main-project and the sub-projects only?


Replies (10)

RE: Issues visible accross all project?! - Added by Jan Niggemann (redmine.org team member) over 11 years ago

Hmmm... Are you 100% sure you haven't either created all 5 projects under a common top-level-project?
Please post a screenshot of administration -> projects or the output of the following database query:
SELECT a.id, a.name, a.parent_id, a.identifier FROM redmine.projects a ORDER BY a.lft

RE: Issues visible accross all project?! - Added by Morten MacFly over 11 years ago

Jan Niggemann wrote:

Hmmm... Are you 100% sure you haven't either created all 5 projects under a common top-level-project?
Please post a screenshot of administration -> projects or the output of the following database query:
SELECT a.id, a.name, a.parent_id, a.identifier FROM redmine.projects a ORDER BY a.lft

Thanks for your help! I cannot post a screenshot, but I am posting the output of the SQL query here:
id name parent_id identifier
1 PRJ1 NULL prj1
2 PRJ2 NULL prj2
3 PRJ3 NULL prj3
4 PRJ4 NULL prj4
5 PRJ5 NULL prj5
6 SP1 5 sp1
7 SP2 5 sp2
8 SP3 5 sp3

I've just replaced the real projects names with short ones.

RE: Issues visible accross all project?! - Added by Morten MacFly over 11 years ago

Morten MacFly wrote:

SELECT a.id, a.name, a.parent_id, a.identifier FROM redmine.projects a ORDER BY a.lft

Maybe something important that I've spotted: "lft" and "rgt" are 1 and 2 respectively for all projects?! Is that correct? What is "lft" and "rgt" supposed to be? Whats the meaning of these?

RE: Issues visible accross all project?! - Added by Jan Niggemann (redmine.org team member) over 11 years ago

From your data I can see that prj1-5 are indeed top-level projects, and SP1-3 are 2nd level projects under prj5.

"lft" and "rgt" are 1 and 2 respectively for all projects?! Is that correct?

No, that's not OK... it's rather strange.

What is "lft" and "rgt" supposed to be? Whats the meaning of these?

lft and rgt are short for "left" and "right", they define the binary tree...

Can you please post the output of
SELECT a.id, a.name, a.parent_id, a.identifier, a.lft, a.rgt, a.inherit_members FROM redmine.projects a ORDER BY a.lft

RE: Issues visible accross all project?! - Added by Morten MacFly over 11 years ago

Thanks again for your reply. I've migrated the DB from an earlier version of Redmine - so that's why it might have happened. The requested output is the same, hence the column with "inherit_members" is zero (0) all the time. "lft" and "rgt" are 1 and 2 respectively for all projects, (as mentioned already).

During migration: What happens if lft and rgt is not present? IN earlier version these fields were not available. So what (and probably) where are these fields being filled during a migration step. Could it be that these are default values? How can I "re-compute" them?

I further digged into the tables comparing the old with the new version and I found out that the "issues" table also has a lft and rgt column now which are 1 and 2 all the time as well... The question is really: Are these default values for the new columns? Was there a step forgotten to re-compute these?

RE: Issues visible accross all project?! - Added by Jan Niggemann (redmine.org team member) over 11 years ago

Morten MacFly wrote:

I further digged into the tables comparing the old with the new version and I found out that the "issues" table also has a lft and rgt column now which are 1 and 2 all the time as well... The question is really: Are these default values for the new columns? Was there a step forgotten to re-compute these?

From which version did you update? Do you still have the old DB? Can you please check the old DB if lft and rgt have different values?
I can't tell you what exactly went wrong, but there's something so utterly wrong that you should dump the updated system....

RE: Issues visible accross all project?! - Added by Morten MacFly over 11 years ago

I updated from v0.8.4. in the end through several steps (first to 1.x.x, then to 2.x.x). The original DB does not have these fields ad If I look at the migration schemes, then it seems as if setting these to 1 and 2 is the default, at least from what I read in "20100313132032_add_issues_nested_sets_columns.rb" in [Redmine]\htdocs\db\migrate. Surely I don't understand the internals though...

BTW: Thanks for sticking with this - I don't take this fro granted, btw..

RE: Issues visible accross all project?! - Added by Jan Niggemann (redmine.org team member) over 11 years ago

Yeah, "nested set" is another name for a binary tree (implementation).
IMHO it is possible to regenerate the needed structure, I don't have enough time ATM...
Please open a issue in the defect tracker.

RE: Issues visible accross all project?! - Added by Morten MacFly over 11 years ago

Jan Niggemann wrote:

Please open a issue in the defect tracker.

I've done it, see:
http://www.redmine.org/issues/14335

I would be interested in a solution that allows me at least to fix the project setup. These are only a few entries to do, so maybe I could do it manually, if I know how...?!

RE: Issues visible accross all project?! - Added by Asif Noor about 9 years ago

Go to your redmine project doc root and execute this

ruby script/rails runner 'Project.rebuild_tree!'

This will recalculate all lft and rgt based on the current projects and correct the project heirarchy.

My Redmine version: 2.4.2
This works fine from 2.0 release.

    (1-10/10)