fixed bug props name change error [safe name change]

master
A1Gard 1 day ago
parent b7c6751cb7
commit 0311d71944

@ -131,8 +131,19 @@ class PropController extends XController
} }
private function updateName($item, $request)
{
if ($item->name != $request->input('name') && $request->input('name') != ''){
foreach (Product::whereHasMeta($item->name)->get() as $product){
$product->setMeta($request->input('name'),$product->getMeta($item->name));
$product->removeMeta($item->name);
}
}
}
public function update(Request $request, Prop $item) public function update(Request $request, Prop $item)
{ {
$this->updateName($item, $request);
return $this->bringUp($request, $item); return $this->bringUp($request, $item);
} }

Loading…
Cancel
Save