-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
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
Cannot watch template variables if Form has notEmpty() rules #567
Comments
Looks like the |
Thank you for your comment. I didn't know |
It was not so easy 😞 At first I was planning to replace closures with string '(closure)' recursively. But it would break objects in view variables, or runs into infinite loops if I don't take care. |
I wonder if we should try storing data that isn't the serialized variables. I don't know what that would be, but Debugger::exportVar() might be a good place to start or use as inspiration. |
If we don't need to use |
Not using |
Hmm. It seems to be harder than I thought. Indeed, using But I think traversing variable like $array = [];
$array['array'] =& $array; It would make DebugKit slow. |
We could keep max-depth shallow, like 3 or 4 levels, as a way to prevent slowdowns. I don't think we'd be able to use |
Oh sorry, I forgot about this issue. Now I am thinking fixing Form::__debugInfo() would be safe, as I am not sure if using Debugger::exportVar() doesn't cause another issues like this. |
Do we need to create an issue in cakephp? |
Is this still valid? |
This issue is stale because it has been open for 120 days with no activity. Remove the |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.5.8
DebugKit Version: 3.11.3
What you did
Use modelless
Form
withnotEmpty()
rule, assign it to template variables, and click theVariables
tab of the DebugKit.What happened
Get
Serialization of 'Closure' is not allowed
error.What you expected to happen
Template variables can be watched.
Why this issue happened
notEmpty()
uses Closures internally andToolbarService
calls serialize() here.(Reported by powder_mikan in #japanese cannel on Slack)
The text was updated successfully, but these errors were encountered: