Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archived builder choices returns boolean instead of strings #4226

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ They keep the focus on elements inside modals and give it back to their parent m
* Fixes a problem in the rich text editor where the slash would not be deleted after item selectin from the insert menu.
* Modules that have a `public` or `i18n` subdirectory no longer generate a
warning if they export no code.
* Archived builder choices method returns booleans instead of strings to match archived filter values.

### Changes

Expand Down
4 changes: 2 additions & 2 deletions modules/@apostrophecms/doc-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1938,11 +1938,11 @@ module.exports = {
// even if everything is in the archive, as "No" is often the default.
return [
{
value: '0',
value: false,
label: 'apostrophe:no'
},
{
value: '1',
value: true,
label: 'apostrophe:yes'
}
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export default {
busy: true,
qs: {
all: '1',
archived: this.relationshipField || this.pageSetMenuSelectionIsLive ? '0' : 'any',
archived: this.relationshipField || this.pageSetMenuSelectionIsLive ? false : 'any',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a query string, booleans aren’t a thing in query string parameter values.

That’s why the string representation is used in this particular case.

I recommend you solve this problem on the other end, by convincing batch operation if to accept strings 0 and 1 as false and true.

// Also fetch published docs as _publishedDoc subproperties
withPublished: 1
},
Expand Down
Loading