-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Acknowledgements] Fix for selecting all roles #9209
[Acknowledgements] Fix for selecting all roles #9209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment above
'affiliations' => $affiliations, | ||
'degrees' => $degrees, | ||
'roles' => $roles, | ||
'affiliations' => implode(',', array_filter(explode(',', $affils))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not do the array_filter before the implode on line 96/99/102?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)