Skip to content

Commit 72e6f76

Browse files
Merge pull request #3286 from DMPRoadmap/fix-template-save
Template visibility changed to organizationally_visible
2 parents b99cadc + 20093d2 commit 72e6f76

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Updated sans-serif font used in PDF downloads to Roboto since Google API no longer offers Helvetica
1313
- Fixed discrepencies with default/max per_page values for API and UI pagination
1414
- Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated.
15+
- Patched an issue that was causing a template's visibility to change to 'organizationally_visible' when saving on the template details page.
1516
- Fixed an issue with the Rails 6 keyword arguments change that was causing the `paginable_sort_link` to fail
1617

1718
### Changed

app/controllers/org_admin/templates_controller.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,11 @@ def parse_visibility(args, org)
385385
# If nil and the org is not a funder, we default to organisational
386386
# If present, we parse to retrieve the value
387387
if args[:visibility].nil?
388-
org.funder? ? 'publicly_visible' : 'organisationally_visible'
388+
org.funder? ? Template.visibilities[:publicly_visible] : Template.visibilities[:organisationally_visible]
389+
elsif %w[0 organisationally_visible].include?(args.fetch(:visibility, 'publicly_visible'))
390+
Template.visibilities[:organisationally_visible]
389391
else
390-
args.fetch(:visibility, '0') == '1' ? 'organisationally_visible' : 'publicly_visible'
392+
Template.visibilities[:publicly_visible]
391393
end
392394
end
393395

0 commit comments

Comments
 (0)