Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/15.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Jan 24, 2025
2 parents 6c21ecd + 9226429 commit 47544ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/models/work_packages/scopes/directly_related.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ module DirectlyRelated
def directly_related(work_package, ignored_relation: nil)
relations_without_ignored = ignored_relation ? Relation.where.not(id: ignored_relation.id) : Relation.all

where(id: relations_without_ignored.where(from_id: work_package).select(:to_id))
.or(where(id: relations_without_ignored.where(to_id: work_package).select(:from_id)))
from_id_relations = relations_without_ignored.where(from_id: work_package).select(:to_id)
to_id_relations = relations_without_ignored.where(to_id: work_package).select(:from_id)

where(arel_table[:id].in(Arel::Nodes::UnionAll.new(from_id_relations.arel, to_id_relations.arel)))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/work_packages/scopes/relatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ def not_having_transitive_relation(work_package, relation_type, ignored_relation
if relation_type == Relation::TYPE_RELATES
# Bypassing the recursive query in this case as only children and parent needs to be excluded.
# Using this more complicated statement since
# where.not(parent:id: work_package.id)
# where.not(parent_id: work_package.id)
# will lead to
# "parent_id != 123" which excludes
# work packages having parent_id NULL.
where.not(id: where(id: work_package.parent_id).or(where(parent_id: work_package.id)).select(:id))
where.not(id: unscoped.where(id: work_package.parent_id).or(unscoped.where(parent_id: work_package.id)).select(:id))
else
sql = <<~SQL.squish
WITH
Expand Down
3 changes: 3 additions & 0 deletions packaging/addons/openproject-edition/bin/configure
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ supported_distribution() {
8*)
return 0
;;
9*)
return 0
;;
esac
;;
esac
Expand Down

0 comments on commit 47544ab

Please sign in to comment.