I've been having an issue with assigning new users to projects.
Create a new project and while still on the projects/new page, try and assign a user. It won't function properly, i.e it will try and make the AJAX call but fails because it returns 0 users.
If you click create, it creates the project just fine. Now delete the assigned user (you, the one who just created the project) and try and assign new users to the project. Again, it won't work because the function returns 0 users.
I was looking through the code pretty quickly and came across the project model - the users_not_in()
function which calls the users()
function within the same class. This function will always return an empty array as long as the projects_users
table in the database is not populated with some form of data.
If you delete all the assigned users of a project, and look at your console, you will see what the GET request is trying to query:
SQL: SELECT * FROM `users` WHERE `id` NOT IN () AND `deleted` = ?
The NOT IN ()
part is the problem as it needs to be passed something.
I am currently trying to figure out the best way to handle this, but I think an open discussion would be great. @mikelbring