Skip to content

[candidate_parameters] Family tab rely on options from SQL instead of redefining them in JS#10510

Open
HachemJ wants to merge 4 commits into
aces:mainfrom
HachemJ:FixFamilyTabLabelsFromSQL
Open

[candidate_parameters] Family tab rely on options from SQL instead of redefining them in JS#10510
HachemJ wants to merge 4 commits into
aces:mainfrom
HachemJ:FixFamilyTabLabelsFromSQL

Conversation

@HachemJ
Copy link
Copy Markdown

@HachemJ HachemJ commented May 27, 2026

Brief summary of changes

Load relationship options dynamically from the database and remove hardcoded values from the frontend.

Testing instructions (if applicable)

  1. Source the database.
  2. Run the patch.
  3. Verify that the family table contains a new column named RelationshipLabel and that all rows have been populated correctly based on their Relationship_type.
  4. Go to the Family Information tab. (The Candidate parameters module is reachable by going to access profile (candidate_list) --> click on a candidate --> click on candidate info)
  5. (Optional) In some cases the Family tab is unaccessible if the study configuration does not have it enabled (check config module). You can also enable it from going to Admin --> Configuration --> select useFamily --> Submit.
  6. Once on the Family Information tab for a given candidate, try deleting or adding rows in the DB and verify that you are able to control the list by adding/removing rows from the DB directly.
  7. If so, success.

Do not expect a successful submission if you try adding a full sibling/half sibling or first cousin between candidates. The functionality currently seems broken on main. #10511

image

Link(s) to related issue(s)

@github-actions github-actions Bot added Language: SQL PR or issue that update SQL code RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: candidate_parameters PR or issue related to candidate_parameters module labels May 27, 2026
@HachemJ HachemJ added State: Needs RB update PR that needs to update Raisinbread to reflect its changes and removed RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset labels May 27, 2026
@HachemJ HachemJ added RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset Release: SQL patch PR that contains an SQL patch to apply labels May 27, 2026
Comment on lines +310 to +322
$db->pselect(
"SELECT DISTINCT Relationship_type, RelationshipLabel
FROM family
WHERE Relationship_type IS NOT NULL
ORDER BY RelationshipLabel",
[]
)
);

$relationshipOptions = [];
foreach ($relationshipList as $row) {
$relationshipOptions[$row['Relationship_type']] = $row['RelationshipLabel'];
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of doing the pselect + a forloop. use the pselectWithIndexKey() dataabse class function

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

implemented change + adapted js, working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Language: SQL PR or issue that update SQL code Module: candidate_parameters PR or issue related to candidate_parameters module RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset Release: SQL patch PR that contains an SQL patch to apply State: Needs RB update PR that needs to update Raisinbread to reflect its changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[candidate_parameters] Family tab should rely on options from SQL instead of redefining them in JS

2 participants