-
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 field are not displaying good selected values on setupUpdateOperation #5378
Comments
Hey @Astriel what kind of relationship is that ? BelongsTo ? Can you try just with the relation name as the field name to check if it does any difference ? CRUD::field('language')->label(__('backpack.language')->hint(__('backpack.create_group_language')); Any chance you have a I was about to ask you if you could reproduce it in our demo, and I noticed that in our demo the BelongsTo relationship was not properly working. I thought you were right, but in the end it was a mistake in our end. We had two fields using the same relationship, so the value of one was overwriting the other. I've fixed it in Laravel-Backpack/demo#581 and belongsTo relations seems to be working just fine, so I will add that you could check:
Let me know if that helps. Cheers |
Bug report
What I did
I've created a CrudController and the UpdateOperation with a relationship field from a 1 <> n relation.
I've already checked all my relations, and they are working properly
What I expected to happen
On the update form / screen I was expecting to have the good ID selected in the relationship field.
If the field is : relationship, the first value of the select is selected, otherwise the good value is displayed
What happened
It is not working with the relationship field, but working with the select field. The field / value that is supposed to be selected is not the good one.
What I've already tried to fix it
Switching from relationship field to the select field.
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug is still there.Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:` ### PHP VERSION:
PHP 8.2.11 (cli) (built: Sep 26 2023 15:25:31) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
LARAVEL VERSION:
10.33.0.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.2
backpack/crud: 6.3.0
backpack/devtools: 2.0.3
backpack/generators: v4.0.2
backpack/logmanager: v5.0.1
backpack/permissionmanager: 7.1.1
backpack/pro: 2.0.18
backpack/theme-coreuiv2: 1.2.2
backpack/theme-coreuiv4: 1.1.1`
The text was updated successfully, but these errors were encountered: