Skip to content

Commit 1d02678

Browse files
committed
fixed an issue that was causing templates.visibility to get set to organizationally_visible even when the org is a funder
1 parent 68ac8a7 commit 1d02678

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
- Added CHANGELOG.md and Danger Github Action [#3257](https://github.com/DMPRoadmap/roadmap/issues/3257)
66
- Added validation with custom error message in research_output.rb to ensure a user does not enter a very large value as 'Anticipated file size'. [#3161](https://github.com/DMPRoadmap/roadmap/issues/3161)
7-
- Added popover for org profile page and added explanation for public plan
7+
- Added popover for org profile page and added explanation for public plan
88
### Fixed
99

1010
- Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated.
11+
- Patched an issue that was causing a template's visibility to change to 'organizationally_visible' when saving on the template details page.
1112

1213
### Changed
1314

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 args.fetch(:visibility, '0') == '1'
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)