stats4sd / aec_portfolio

A proof of concept for the AEC Consortium Project Management / Assessment System
GNU General Public License v3.0
0 stars 0 forks source link

Error when inviting users: Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null (Connection: ... #281

Closed sentry-io[bot] closed 1 week ago

sentry-io[bot] commented 3 weeks ago

My assumption is that the user added multiple email fields and left one field blank, causing the error.

We should check this and remove any blank email fields before processing the form submission data during the invite process.

Sentry Issue: AE-FINANCE-ASSESSMENT-TOOL-AGROECOLOGY-COALITION-O-M

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null
  File "/app/Models/Organisation.php", line 145, in App\Models\Organisation::sendInvites
    $invite = $this->invites()->create([
  File "/app/Http/Controllers/OrganisationMemberController.php", line 46, in App\Http\Controllers\OrganisationMemberController::store
    $organisation->sendInvites($data['emails'], $data['role_id']);
  File "/app/Http/Middleware/CheckIfAdmin.php", line 54, in App\Http\Middleware\CheckIfAdmin::handle
    return $next($request);
  File "/public/index.php", line 51
    $response = tap($kernel->handle(
...
(72 additional frame(s) were not displayed)

Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null (Connection: mysql, SQL: insert into `invites` (`email`, `inviter_id`, `token`, `organisation_id`, `updated_at`, `created_at`) values (?, 53, NDaeZJfgpCHDK1Z5NlFztXDQ, 37, 2024-08-29 08:25:06, 2024-08-29 08:25:06))
  File "/app/Models/Organisation.php", line 145, in App\Models\Organisation::sendInvites
    $invite = $this->invites()->create([
  File "/app/Http/Controllers/OrganisationMemberController.php", line 46, in App\Http\Controllers\OrganisationMemberController::store
    $organisation->sendInvites($data['emails'], $data['role_id']);
  File "/app/Http/Middleware/CheckIfAdmin.php", line 54, in App\Http\Middleware\CheckIfAdmin::handle
    return $next($request);
  File "/public/index.php", line 51
    $response = tap($kernel->handle(
...
(70 additional frame(s) were not displayed)