Fix initiatives signatures issues#8448
Conversation
|
Ok, I can confirm that this works as expected (or at least that's consistent with the bugs that show in different types of initiatives 😅). Just a minor detail, it seems like the signature counter isn't updated when seeing the card in navigation: This is the initiative page (it shows the correct counter): Could you please review that @leio10 🙏🏽? |
|
@andreslucena I'm checking the bug you are reporting, but I'm not able to reproduce it. The code seems to be ok, and in my local instance works properly. In my instance, the value for Can you check in the console if the value for that field in your app also has a value for the |
@leio10 there's no total key: irb(main):014:0> Decidim::Initiative.last.offline_votes
Decidim::Initiative Load (0.4ms) SELECT "decidim_initiatives".* FROM "decidim_initiatives" ORDER BY "decidim_initiatives"."id" DESC LIMIT $1 [["LIMIT", 1]]
=> {"global"=>88}
irb(main):015:0> Decidim::Initiative.last
Decidim::Initiative Load (0.4ms) SELECT "decidim_initiatives".* FROM "decidim_initiatives" ORDER BY "decidim_initiatives"."id" DESC LIMIT $1 [["LIMIT", 1]]
=> #<Decidim::Initiative id: 9, title: {"ca"=>"", "en"=>"Presential", "es"=>""}, description: {"ca"=>"", "en"=>"<p>Presential</p>", "es"=>""}, decidim_organization_id: 1, decidim_author_id: 1, published_at: "2021-11-05 08:49:28", state: "published", signature_type: "offline", signature_start_date: "2021-11-05", signature_end_date: "2022-03-05", answer: nil, answered_at: nil, answer_url: nil, created_at: "2021-11-05 08:49:11", updated_at: "2021-11-05 08:49:42", decidim_user_group_id: nil, hashtag: "", scoped_type_id: 11, first_progress_notification_at: nil, second_progress_notification_at: nil, decidim_author_type: "Decidim::UserBaseEntity", reference: "MD-INIT-2021-11-9", online_votes: {}, offline_votes: {"global"=>88}, decidim_area_id: nil, comments_count: 0, follows_count: 1>Steps to reproduce:
irb(main):018:0> Decidim::InitiativesType.last
Decidim::InitiativesType Load (0.3ms) SELECT "decidim_initiatives_types".* FROM "decidim_initiatives_types" ORDER BY "decidim_initiatives_types"."id" DESC LIMIT $1 [["LIMIT", 1]]
=> #<Decidim::InitiativesType id: 5, title: {"ca"=>"", "en"=>"A new initiative type", "es"=>""}, description: {"ca"=>"", "en"=>"<p>with a description</p>", "es"=>""}, decidim_organization_id: 1, created_at: "2021-11-05 08:46:35", updated_at: "2021-11-05 08:46:35", banner_image: nil, collect_user_extra_fields: false, extra_fields_legal_information: {"ca"=>"", "en"=>"", "es"=>""}, minimum_committee_members: 0, validate_sms_code_on_votes: false, document_number_authorization_handler: "", undo_online_signatures_enabled: false, promoting_committee_enabled: false, signature_type: "offline", child_scope_threshold_enabled: false, only_global_scope_enabled: false, custom_signature_end_date_enabled: false, attachments_enabled: false, area_enabled: false> |
|
I'm retaking this issue. With 85ecef6 we've solved the bug of my last comment #8448 (comment). The problem was that when it was setting the I also merged against |
* develop: (57 commits) Add a subtitle to assemblies and processes pages (#8918) Add a subtitle to votings page (#8919) Fix profile notifications (#8943) Fix email for verification conflict with managed users (#8926) Move VAPID keys generators to core (#8923) Fix officialized user event missing translations (#8927) Fix verification report with multitenants: notify it only to admins of that organization (#8929) Fix processes creation form with stats, metrics and announcements (#8925) Fix flaky spec in meetings multi-date selectors (#8924) Local HTML validator for the CI (#8937) Fix translatable presence validator for hyphenated locales (#8795) Fix link to docs in initiatives admin (#8921) Fix initiatives signatures issues (#8448) Fix the meetings export to also include unpublished meetings (#8874) Fix heading order in the consultation question page (#8920) Fix diff mode selector roles and tabindexes (#8912) Fix budget hard dependency and caching flag issues in comments (#8899) Fix emoji picker hiding Foundation Abide form errors (#8886) Fix logical heading order for the endorsers list (#8892) Fix Foundation Abide errors for Rails remote (AJAX) forms (#8889) ...
Co-authored-by: Andrés Pereira de Lucena <andreslucena@gmail.com>




🎩 What? Why?
As described in #6862, initiatives offline signatures were not being shown and it was not possible to accept initiatives even when the goal was reached. It turns that the second issue is not related to the offline signatures, but to another bug related to the way iniative types are used. This PR fixes both.
📌 Related Issues
Testing
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots
Please add screenshots of the changes you're proposing
