Handling exceptions more graceful
Currently, when there is sth wrong, the custom panel just shows
[Warning (2) ](javascript:void(0);): Undefined variable $authenticationProvider
[in /shared/httpd/app/vendor/dereuromark/cakephp-tinyauth/templates/element/auth_panel.php, line 68]
and many more
Which would be impossible if the AuthPanel class would run properly as those data would be passed down
Only by debugging the template and dd($this->viewVars) you find out that:
ROOT/vendor/dereuromark/cakephp-tinyauth/templates/element/auth_panel.php (line 21)
[
'error' => 'Serialization of 'Closure' is not allowed',
'panel' => object(DebugKit\Model\Entity\Panel) id:0 { },
'sort' => null,
]
but with no clear message on where and what
It seems data() still contains everything, but then afterwards it fails.
ROOT/vendor/dereuromark/cakephp-tinyauth/src/Panel/AuthPanel.php (line 126)
[
'params' => [ ],
'path' => 'Admin/Overview',
'availableRoles' => [ ],
'user' => [ ],
'roles' => [ ],
'config' => [ ],
'access' => [ ],
'identity' => object(Authorization\Identity) id:5 { },
'authenticationProvider' => object(TinyAuth\Authenticator\PrimaryKeySessionAuthenticator) id:12 { },
'identificationProvider' => object(Authentication\Identifier\TokenIdentifier) [id: 14](http://ww.local/admin#cake-db-object-68417089c37f99.24774647-14) {},
'isPublic' => false,
]
Why wouldnt it just pass down the array and instead tries to serialize sth?
I was able to find out it is those two
$data['authenticationProvider'] = $auth ? $auth->getAuthenticationProvider() : null;
$data['identificationProvider'] = $auth ? $auth->getIdentificationProvider() : null;
causing it then in the end
Why wouldnt it just pass down the array and instead tries to serialize sth?
Panel content has to be serializable for the history to work.
I guess not much possible here then.