We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a model with RequiredApproval is freshly created, a Modification is created correctly. When I approve it using:
$user->approve($modification);
and since it has 0 remaining approvers left it tries to apply the changes and I get:
Call to a member function applyModificationChanges() on null
which makes sense as here:
$modification->modifiable->applyModificationChanges($modification, true);
I guess there is no 'modifiable' (as the record does not exist yet / has no idea).
Am I missing something here? Love your work, works perfect for changes but I can't seem to get it to work for creations.
The text was updated successfully, but these errors were encountered:
Thanks for the report, I'll unfortunately only be able to look into this later this week.
Sorry, something went wrong.
I currently do this dirty hack in ApprovesChanges trait (mind you, novice developer):
if ($modification->approversRemaining == 0) { if($modification->modifiable_id === null) { $polymorphicModel = new $modification->modifiable_type(); $polymorphicModel->applyModificationChanges($modification, true); } else { $modification->modifiable->applyModificationChanges($modification, true); } }
stephenlake
Successfully merging a pull request may close this issue.
When a model with RequiredApproval is freshly created, a Modification is created correctly. When I approve it using:
$user->approve($modification);
and since it has 0 remaining approvers left it tries to apply the changes and I get:
Call to a member function applyModificationChanges() on null
which makes sense as here:
$modification->modifiable->applyModificationChanges($modification, true);
I guess there is no 'modifiable' (as the record does not exist yet / has no idea).
Am I missing something here? Love your work, works perfect for changes but I can't seem to get it to work for creations.
The text was updated successfully, but these errors were encountered: