[Acknowledgements] Fix for selecting all roles#9209
Conversation
There was a problem hiding this comment.
Tested and main fix works, all roles are saved. The second fix to remove the undefined value not work though, undefined is still present:
I wonder if the cleanup should be done on the frontend before it passes undefined.
I'm also curious about the reason insertIgnore vs insert fix the issue. @ridz1208, idea?
| 'affiliations' => $affiliations, | ||
| 'degrees' => $degrees, | ||
| 'roles' => $roles, | ||
| 'affiliations' => implode(',', array_filter(explode(',', $affils))), |
There was a problem hiding this comment.
why not do the array_filter before the implode on line 96/99/102?
There was a problem hiding this comment.
I think since the fields are strings and not arrays, it skips lines 96, 99, and 102. I didn't want to get rid of that part though as I don't know if there was some other reason for it. By doing it later it makes sure to do it for all cases without duplicating the codes on 96 and 97, 99 and 100, and 102 and 103
|
Looks like this was caused by all the roles selected = character count > 258, and the sql column can only handle up till 255 |
|
@laemtl turns out it worked as insertIgnore was ignoring the fact that it couldn't insert a value > than the sql table can handle. Definitely not the correct fix so I am re-doing it |
Brief summary of changes
Testing instructions (if applicable)
Link(s) to related issue(s)