CareSet / DURC

DURC is reverse CRUD
MIT License
3 stars 2 forks source link

Using getNameField for the DURC editing pages #79

Closed ftrotter closed 3 years ago

ftrotter commented 4 years ago

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...

kchapple commented 3 years ago

@ftrotter is this related or a dup of #76 ?

kchapple commented 3 years ago

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()

kchapple commented 3 years ago

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.

Screen Shot 2020-09-08 at 10 06 09 AM
kchapple commented 3 years ago

@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.

Screen Shot 2020-09-08 at 11 39 43 AM
seanccsmith commented 3 years ago

Did we decide that this is a dup of #76 ? If so this looks good and can be closed.

seanccsmith commented 3 years ago

If I'm understanding this correctly, this looks like it's working as expected.