-
Notifications
You must be signed in to change notification settings - Fork 879
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
[Bug] relationship with subfields (and probably repeatable) incorrect reflection of the translatable fields #4357
Comments
Hello @guleswine Thanks again for one more issue report. I think I got this fixed in #4267 If you have time do you want to give it a try and let us know ? It could help alot in the review process and finding something that slipped me. Cheers |
@pxpm hi, i checked your great idea (which will be very helpful when translating models). But it doesn't always work well and correctly.
config/translatable.php
P.S. |
Hello @guleswine so that we are on the same page here:
So, I found an issue, but not the one you described.
I've already come up with a solution for the first problem I described. #4359 I haven't found a solution for the second, nor I could reproduce your issue. https://recordit.co/KJSMUzu07w This video is made after in the branch with the mentioned pull request, without it, it would save the FR and IT values, but it would always display the EN version. |
in your example, you have filled in both fields, but it may be worth filling out only one, and at the same time check what will be reflected with the setting fallback_locale => null |
This comment was marked as off-topic.
This comment was marked as off-topic.
You've been very helpful finding this corner cases, for that I thank you very much 🙏 Will have a look too on this last one you described! Cheers |
Hello @pxpm, i encounter this bug in the last versions. backpack/crud: 6.7.14 and backpack/pro: 2.2.0 I have model protected $fillable = [
'page_id',
'key',
'text'
];
protected $translatable = ['text']; Field translations $this->crud->field([
'name' => 'translations',
'type' => "relationship",
'subfields' => [
[
'name' => 'key',
'type' => 'text',
'wrapper' => [
'class' => 'form-group col-md-3',
],
'attributes' => $attributes,
],
[
'name' => 'text',
'type' => 'textarea',
'wrapper' => [
'class' => 'form-group col-md-9',
],
]
],
'tab' => 'Translations'
]);
I try to debug but didn't succeed. When the value is in the array items in the repeatable.blade alerady is a json insted of a "". |
Hey @adriallongarriu Can you check if #4267 fixes your issue ? You can request that branch by adding in your "backpack/crud": "dev-translatable-with-fallbacks as 6.7" It was revived a few weeks ago and should be merged anytime soon. Cheers |
@pxpm tested with |
Thanks for confirming @adriallongarriu 🙏 That's excellent news! 🥳 We should merge that PR sooner than later, we are just waiting for a colleague too give the thumbs up. |
This should be fixed in 6.7.17 merged #4267 Let us know if that's not the case 🙏 Cheers |
Bug report
What I did
i make relationship
this fields is translatable
public $translatable = ['text','img','buttons'];
What I expected to happen
reflection of blank lines when there is no data in my locale or locale has 'NULL' data
What happened
What I've already tried to fix it
vendor/backpack/pro/resources/views/fields/relationship.blade.php
I found that if there is no value for my locale, the entire value from the table field in json format gets here.
and I have no idea how to fix it except dirty check in view
Is it a bug in the latest version of Backpack?
yes
Backpack, Laravel, PHP, DB version
last versions
The text was updated successfully, but these errors were encountered: