Describe the bug
When i go to the conference page, I can see the conference venues section with addresses even though there are no published meetings.
To Reproduce
- Go to try.decidim.org and login as admin
- Visit a Conference, and check the venues seciton
- Go to admin section, in the meetings component listing
- Unpublish all the meetings
- Go to frontend and refresh the page
- See the Conference Venues and see that addresses are still visible.
Expected behavior
When the meetings are Hidden (moderated), unpublished, or private the addresses should not be visible.
Screenshots
No response
Stacktrace
No response
Extra data
- Decidim Version: 0.27, 0.28
- Decidim installation: try.decidim.org
Additional context
|
Decidim.view_hooks.register(:conference_venues, priority: Decidim::ViewHooks::HIGH_PRIORITY) do |view_context| |
|
published_components = Decidim::Component.where(participatory_space: view_context.current_participatory_space).published |
|
meetings = Decidim::Meetings::Meeting.where(component: published_components).group_by(&:address) |
|
meetings_geocoded = Decidim::Meetings::Meeting.where(component: published_components).geocoded |
|
next unless meetings.any? |
|
|
|
view_context.render( |
|
partial: "decidim/participatory_spaces/conference_venues", |
|
locals: { |
|
meetings:, |
|
meetings_geocoded: |
|
} |
|
) |
|
end |
|
end |
Describe the bug
When i go to the conference page, I can see the conference venues section with addresses even though there are no published meetings.
To Reproduce
Expected behavior
When the meetings are Hidden (moderated), unpublished, or private the addresses should not be visible.
Screenshots
No response
Stacktrace
No response
Extra data
Additional context
decidim/decidim-meetings/lib/decidim/meetings/engine.rb
Lines 84 to 98 in 18036d4