roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Fixed bug in org links validator

Open briri opened this issue 10 months ago • 0 comments

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.

briri avatar Feb 28 '25 18:02 briri