Skip to content

Conference venues displays addresses from hidden and moderated meetings  #11540

@alecslupu

Description

@alecslupu

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

  1. Go to try.decidim.org and login as admin
  2. Visit a Conference, and check the venues seciton
  3. Go to admin section, in the meetings component listing
  4. Unpublish all the meetings
  5. Go to frontend and refresh the page
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions