Skip to content

Require the necessary "zip" gem in the open data exporter#6464

Merged
tramuntanal merged 1 commit intodecidim:developfrom
mainio:fix/open-data-export
Nov 3, 2020
Merged

Require the necessary "zip" gem in the open data exporter#6464
tramuntanal merged 1 commit intodecidim:developfrom
mainio:fix/open-data-export

Conversation

@ahukkanen
Copy link
Copy Markdown
Contributor

🎩 What? Why?

Without this, the exporter would not work in environments where the "zip" gem is not explicitly loaded through the Gemfile, as in most Decidim instances.

Why I think it works with the rspec tests is that it loads all the Decidim's dependency gems through the dummy app's Gemfile (which is the Gemfile at the root of this project). However, this is not the case in many production environments.

Without this, the exporter would not work in environments where
the "zip" gem is not explicitly loaded through the Gemfile, as in
most Decidim instances.
carlobeltrame added a commit to puzzle/decidim-zuerich that referenced this pull request Sep 9, 2020
This will be obsolete once we use a release of decidim that includes
this PR: decidim/decidim#6464
carlobeltrame added a commit to puzzle/decidim-zuerich that referenced this pull request Sep 9, 2020
This will be obsolete once we use a release of decidim that includes
this PR: decidim/decidim#6464
carlobeltrame added a commit to puzzle/decidim-zuerich that referenced this pull request Sep 9, 2020
This will be obsolete once we use a release of decidim that includes
this PR: decidim/decidim#6464
@carlobeltrame
Copy link
Copy Markdown
Contributor

In my experiments, when I add the zip gem to a decidim project (using bundle add zip), I still get the following error:

NameError (uninitialized constant Zip::OutputStream)

It seems Zip::OutputStream is defined in the rubyzip gem, but adding that one as well doesn't solve the problem either.

Any idea how to work around this issue until this PR is merged and released?

@ahukkanen
Copy link
Copy Markdown
Contributor Author

@carlobeltrame You can just override the file locally in your instance by creating the same service file in your application.

To patch, run this at the root of your project:

cd /path/to/your/project
mkdir -p app/services/decidim && wget -O app/services/decidim/open_data_exporter.rb https://raw.githubusercontent.com/decidim/decidim/474c845d313a86e290b36b1b1b8382d1fdccc306/decidim-core/app/services/decidim/open_data_exporter.rb

Remember to remove it with the next version after this will be merged to core!

@ahukkanen
Copy link
Copy Markdown
Contributor Author

Is there something blocking this getting merged?

This applies the same fix to the open data exported what is already applied in the core in multiple locations:


@tramuntanal tramuntanal merged commit 6bbbde2 into decidim:develop Nov 3, 2020
ahukkanen added a commit to mainio/decidim that referenced this pull request Nov 3, 2020
Without this, the exporter would not work in environments where
the "zip" gem is not explicitly loaded through the Gemfile, as in
most Decidim instances.
@ahukkanen ahukkanen deleted the fix/open-data-export branch November 3, 2020 09:43
tramuntanal pushed a commit that referenced this pull request Nov 4, 2020
)

Without this, the exporter would not work in environments where
the "zip" gem is not explicitly loaded through the Gemfile, as in
most Decidim instances.
@mrcasals mrcasals added module: core type: fix PRs that implement a fix for a bug labels Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: core type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants