Skip to content

Exception: Serialization of 'Closure' is not allowed #103

Open
@s-ohnishi

Description

@s-ohnishi

In the searchAction of the controller, it is stored in Session/Bag as follows.
However, the array returned by getParams() contains di, and Closure exists in it, so it cannot be serialized, so it fails to save to the session.

$this->persistent->searchParams = $query->getParams();

This failure can be avoided by excluding the key di from the array returned by getParams().
for example

             $params = $query->getParams();
             unset($params['di']);
             $this->persistent->searchParams = $params;

or

$this->persistent->searchParams = array('di'=>null) + $query->getParams();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions