Skip to content

[Bug] PHP Deprecated: Optional parameter HasForm #5458

@adriallongarriu

Description

@adriallongarriu

Bug report

What happened

I upload a new project to a new server with 8.2.11
On acces the admin created a error.log with the error:

PHP Deprecated:  Optional parameter $id declared before required parameter $formLogic is implicitly treated as a required parameter in .../vendor/backpack/crud/src/app/Http/Controllers/Operations/Concerns/HasForm.php on line 104

Line 104

public function formAction(?int $id = null, callable $formLogic)
{
//
}

What I've already tried to fix it

I followed https://php.watch/versions/8.0/deprecate-required-param-after-optional
image

The error was reptining multiple times and for not create a larage log flies i temporary i changed vendor to:

public function formAction(?int $id, callable $formLogic)
{
//
}

Is it a bug in the latest version of Backpack?

Yes

Backpack, Laravel, PHP, DB version

LARAVEL VERSION:

10.43.0.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.2.2
backpack/crud: 6.6.2
backpack/generators: v4.0.3
backpack/permissionmanager: 7.1.1
backpack/pro: 2.1.2
backpack/settings: 3.1.0
backpack/theme-tabler: 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions