Closed ftrotter closed 3 years ago
@ftrotter is this related or a dup of #76 ?
To fix that, I used the same code in the search function of the controller (which displays the results list in the select2 dropdown) but I can replace that search function and the field display function with the result of Model::getNameField()
I re-ran durc and there seems to be a bug causing those two repo fields not to get their display values, and is crashing the select2 plugin. Plan of action is to 1: Fix bug 2: refactor so all of the "select text" comes from the getFieldName() function, rather than the controller functions.
@ftrotter I fixed the bug that was causing the select2 to not function. Now it pulls correctly from the related model using the controller code. I didn't make it look for the "local" name field from the same table. That seems weird to me from a relational DB standpoint, because if you update the project repo, then you'd also always have to update the repo name, which is already on the related model's table, so not sure why you'd even need the repo name field, or it shouldn't it be on the related model. Bug was in the mustache generator for select2, so will need to re-write views.
Did we decide that this is a dup of #76 ? If so this looks good and can be closed.
If I'm understanding this correctly, this looks like it's working as expected.
The method used to populate the name in the DURC web form drop down is not tying back to the DURCModel->getNameField() function to sort out which name should display. Is this something that can be fixed? https://github.com/CareSet/DURC/blob/master/src/DURCModel.php#L308
To see the problem look at onering url /DURC/podproject/1016 and look at the project repo id field... It should be finding the repoName field but it is not...