Skip to content

Commit

Permalink
Merge pull request #5521 from Laravel-Backpack/register-field-events-…
Browse files Browse the repository at this point in the history
…on-update-form

Register field events on UpdateOperation edit form
  • Loading branch information
pxpm committed May 16, 2024
2 parents 1fe921d + f442606 commit 90f1482
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/Http/Controllers/Operations/UpdateOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ protected function setupUpdateDefaults()
public function edit($id)
{
$this->crud->hasAccessOrFail('update');

// get entry ID from Request (makes sure its the last ID for nested resources)
$id = $this->crud->getCurrentEntryId() ?? $id;
// get the info for that entry

// register any Model Events defined on fields
$this->crud->registerFieldEvents();

// get the info for that entry
$this->data['entry'] = $this->crud->getEntryWithLocale($id);

$this->crud->setOperationSetting('fields', $this->crud->getUpdateFields());

$this->data['crud'] = $this->crud;
Expand Down

0 comments on commit 90f1482

Please sign in to comment.