Fix fetching comments through the API for accountability and budgets#15170
Closed
ahukkanen wants to merge 7 commits intodecidim:developfrom
Closed
Fix fetching comments through the API for accountability and budgets#15170ahukkanen wants to merge 7 commits intodecidim:developfrom
ahukkanen wants to merge 7 commits intodecidim:developfrom
Conversation
The projects should be visible in the API result, I believe.
As the comment authors are now confirmed user accounts, they add to the total amount of users.
ahukkanen
added a commit
to City-of-Turku/decidim-module-apiext
that referenced
this pull request
Sep 10, 2025
Apply the fix from the following core PR: decidim/decidim#15170 Comments fetching was broken since 0.28.5 due to this breaking change: decidim/decidim#13759
alecslupu
suggested changes
Oct 26, 2025
Contributor
alecslupu
left a comment
There was a problem hiding this comment.
@ahukkanen Could you merge with the latest develop branch ? Also could you check the suggestions?
Comment on lines
+21
to
+25
| if result && !result.deleted? | ||
| allow! | ||
| else | ||
| disallow! | ||
| end |
Contributor
There was a problem hiding this comment.
why not a simple:
Suggested change
| if result && !result.deleted? | |
| allow! | |
| else | |
| disallow! | |
| end | |
| toggle_allow(result && !result.deleted?) |
Comment on lines
+51
to
+55
| if project && !project.deleted? && !project.budget.deleted? | ||
| allow! | ||
| else | ||
| disallow! | ||
| end |
Contributor
There was a problem hiding this comment.
Suggested change
| if project && !project.deleted? && !project.budget.deleted? | |
| allow! | |
| else | |
| disallow! | |
| end | |
| toggle_allow(project && !project.deleted? && !project.budget.deleted?) |
Contributor
|
@ahukkanen thank you for your fix! I am closing this in favour of #15979, so that we can fix the outstanding issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
Currently fetching comments through the API for accountability results or budgeting projects is broken.
This is caused by the API authorization checks introduced at #13759.
Affected versions
0.28.5and up.📌 Related Issues
Testing
Decidim::Accountability::ResultandDecidim::Budgets::Project){ commentable(type: "Decidim::Accountability::Result", id: "1", locale: "en", toggleTranslations: false) { totalCommentsCount comments { ...dataFragment comments { ...dataFragment comments { ...dataFragment } } } } } fragment dataFragment on Comment { id body author { name } createdAt }