Skip to content
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

Always include locale in the mediables pivot #2368

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Conversation

bonroyage
Copy link
Contributor

Description

#2320 added support for copying the locale when duplicating models with mediables, but since the locale isn't included in the pivot when the config was false, this would have caused the value from the pivot to be null and thus causes the tests to fail.

The fix is to always include locale in the pivot, regardless of the config.

Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'locale' cannot be null (Connection: mysql, SQL: insert into `twill_mediables` (`created_at`, `crop`, `crop_h`, `crop_w`, `crop_x`, `crop_y`, `locale`, `media_id`, `mediable_id`, `mediable_type`, `metadatas`, `ratio`, `role`, `updated_at`) values (2023-11-03 08:57:44, default, ?, ?, ?, ?, ?, 1, 2, App\Models\XBleafe, [], default, cover, 2023-11-03 08:57:44))

@ifox ifox merged commit 7bdba63 into area17:3.x Nov 16, 2023
8 checks passed
@bonroyage bonroyage deleted the fix/test branch November 20, 2023 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants