Open jonnywilliamson opened 7 months ago
Actually having another look at it I see that the issue might be the same issue as https://github.com/stepanenko3/nova-command-runner/issues/20
The constructor of RunDTO sets the run_by to the name
of auth user .
But my users don't have a name
field. They have a first_name
field instead. So this is where the null is coming from.
It's only become apparent because of the change of adding type checking to the class properties.
Opened #42 to fix this. Although the package is still broken because of #30
As an alternative, I'd suggest either downgrading to 4.2.7 or using 4.3.4 and adding this to your user model:
public function getNameAttribute(): string
{
return $this->first_name;
}
Hi there,
I've been using this nova plugin for quite a while now with no issues, until a few days ago after I updated it. Haven't changed anything in the config etc, but when I run my command from the nova dashboard I get a server 500 error.
The error is as follows in the log:
Having a look at the
RunDto
I see a recent change in commithttps://github.com/stepanenko3/nova-command-runner/commit/954ae263e96107acc35818ab4e3d81deefba440b#diff-34ea08736004df131df35da01543bdd3ea44ce5506612c743557fb6b63833cf3L9-L21
Where you marked everything apart from $run_by as a nullable string
However in your
CommandsController.php
you try and run the command with anew RunDTO()
object that has no parameters and so it's trying to set $run_by as null and so throwing the error. (I think).https://github.com/stepanenko3/nova-command-runner/blob/main/src/Http/Controllers/CommandsController.php#L117
Not sure what would be best here, but thought I'd just highlight it as an issue as I can't get the commands to run online anymore.
Thanks.