Skip to content

Conversation

@aaronskiba
Copy link
Contributor

Fixes #3528

Changes proposed in this PR:

  • This change resolves issue BUG: Updating Org Fields Can Set Org.managed to false #3528 by preventing the updating of @org.managed when attrs[:managed] is missing. Prior to this change, the if attrs.key?(:managed) was not present. But it was necessary, because that key is not present when a super user clicks "Save" on the "Request Feedback" page.
  • As a result, if attrs[:managed] was not present, then attrs[:managed] = (attrs[:managed] == '1') would evaluate false, and if @org.update(attrs) (line 81) would subsequently update @org.managed to false in the db.

@aaronskiba aaronskiba changed the title Fix handling of attrs[:managed] on Org updates Fix handling of attrs[:managed] + Refactor OrgsController#admin_update Jun 2, 2025
@aaronskiba aaronskiba marked this pull request as ready for review June 2, 2025 20:33
@aaronskiba aaronskiba marked this pull request as draft June 6, 2025 18:40
@aaronskiba aaronskiba marked this pull request as ready for review June 9, 2025 15:24
@johnpinto1 johnpinto1 self-requested a review June 17, 2025 14:33
@aaronskiba aaronskiba force-pushed the upstream/aaron/issues/org-managed-bugfix branch 2 times, most recently from 475ce66 to 9b6d23f Compare November 12, 2025 20:32
This change resolves issue DMPRoadmap#3528 by preventing the updating of `@org.managed` when `attrs[:managed]` is missing.
Prior to this change, the `if attrs.key?(:managed)` was not present. But it was necessary, because that key is not present when a super user clicks "Save" on the "Request Feedback" page.
- As a result, if `attrs[:managed]` was not present,  then `attrs[:managed] = (attrs[:managed] == '1')` would evaluate false, and `if @org.update(attrs)` (line 81) would subsequently update `@org.managed` to false in the db.
This refactor is meant to serve as a small step in simplifying  `OrgsController#admin_update` controller action, which currently contains a lot of rubocop offences.

- Moved `attrs[:logo]` handling logic into `handle_logo(attrs)`

- Moved Shibboleth identifier handling into `handle_shibboleth_identifier(attrs)`
@aaronskiba aaronskiba force-pushed the upstream/aaron/issues/org-managed-bugfix branch from 9b6d23f to 5da1ba8 Compare November 12, 2025 20:36
@aaronskiba aaronskiba closed this Nov 12, 2025
@aaronskiba aaronskiba reopened this Nov 12, 2025
@aaronskiba aaronskiba changed the base branch from development to main November 12, 2025 20:39
Copy link
Contributor

@johnpinto1 johnpinto1 left a comment

Choose a reason for hiding this comment

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

Super admin's view an Organisation details:
Refactoring and fix working fine for missing "Managed".

Not sure why "Managed" is cited as a mandatory field. (Is it worthwhile removing the asterisk?).
Also it looks like you can never save if the mandatory field "Contact email" is missing, but you can if "Link text" is missing. I guess this is something added in past, super admins are fine with this convention.

@aaronskiba aaronskiba changed the base branch from main to next-release/v5.0.3 December 4, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants