Skip to content

Fixed bug in org links validator #3480

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

briri
Copy link
Contributor

@briri briri commented Feb 28, 2025

We came across an issue in with the Org Links Validator last week that was being caused by an edge case.

The issue is that the k variable referenced in the validator does not exist.

It was an edge case because the Org model defaults the value to {"org":[]}. We had some old records in our DB though that had a NULL value in the field, and our admin tried to merge one of them.

To replicate the issue:

  • Manually set an org's links value in the database. For example: UPDATE orgs SET links = NULL WHERE id = ?;
  • Then trigger a call to the valid? method on the org somewhere in the code. We discovered it when trying to merge 2 orgs, but you could just as well add a puts @org.valid? line on the "Org details" page.

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.

1 participant