-
Notifications
You must be signed in to change notification settings - Fork 893
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] Error 'The name is already used' on crud update #5241
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
my rules on ChantiersRequest |
Hello @AndreNeny i dont think this is a backpack bug because is about rules, Backpack didnt handle it: if i see your rules did you try with ignore?
Cheers. |
Doing a cleanup of stalled issues. Please @AndreNeny report back if you were not able to fix it and we can re-open this. Cheers |
Hello Jorge,
Thanks a lot for your response. I will try - ignore as soon as possible.
Cheers,
André Nény
Le jeu. 3 août 2023 à 22:48, Jorge ***@***.***> a écrit :
… Hello @AndreNeny <https://github.com/AndreNeny> i dont think this is a
backpack bug because is about rules, Backpack didnt handle it:
if i see your rules did you try with ignore?
public function rules()
{
return [
'nom' => [
'required',
'min:3',
'max:40',
Rule::unique('chantiers')->where(function ($query) { // Clé unique composée : societe_id + nom
return $query->where('societe_id', $this->societe_id)->ignore([here_the_current_id]);
}),
],
'image' => 'max:65535',
'latitude' => 'required|numeric',
'longitude' => 'required|numeric'
];
}
Cheers.
—
Reply to this email directly, view it on GitHub
<#5241 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKHAHYQ6PYG4CQ34RH6BUILXTQFBVANCNFSM6AAAAAA24LMPP4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello Jorge, That's good with your advice. Thank's a lot ! |
Bug report
What I did
my model has two keys :
primary key Id
unique key chantiers_nom_unique (firm_code + chantier_name)
nothing special on standard crud, no implementation of the save method.
What I expected to happen
standard crud update () when another field (not firm_code or chantier_name) is modified in the model
and message "item has been updated with success"
What happened
Error "The name already used"
What I've already tried to fix it
/
Is it a bug in the latest version of Backpack?
I don't think so but my double key is recent.
After I run
composer update backpack/crud
the bug... is it still there?Yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
PHP 8.1.20 (cli) (built: Jun 7 2023 08:21:17) (NTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.20, Copyright (c) Zend Technologies
LARAVEL VERSION:
v9.17.0@091e287678ac723c591509ca6374e4ded4a99b1c
BACKPACK VERSION:
5.1.2@a15f93a784e8d130f5ea5c3341fb7bca1f3c25e3
Thank's to look at this !
The text was updated successfully, but these errors were encountered: