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

Fix new translation is missing the relation id for saving #418

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

Tofandel
Copy link
Contributor

@Tofandel Tofandel commented Jul 5, 2024

If we do

$tr = $model->translateOrNew('en');
$tr->some_field = 'abc';
$tr->save();

We get a query exception (Field ..._id doesn't have a default value) because the package is not setting the relation key

This PR fixes the issue

Copy link
Member

@Gummibeer Gummibeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvement. The translation model was never meant to be saved standalone but be saved through the main model. But as it's a very simple fix I'm happy to merge it in.

@Gummibeer Gummibeer merged commit 979d18d into Astrotomic:main Jul 10, 2024
12 checks passed
@Gummibeer
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants