-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Call to undefined method Symfony\Component\VarDumper\Caster\CutStub::clear() #23110
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
Comments
Can you show the code of |
Here it is. Look for the comment "THIS IS THE LINE" below.
|
I've the same issue after upgrade from 3.2.x to 3.3.2. Some infos about the issue I've found until now: Problem appear, if the test calls a page which has a form included and the from itself has a form field with EntityType::class type. The error is thrown during $form->createView(). |
Could any of you please provide us a small reproducer we could run locally? |
So far I have no succuess to reproduce this error on a clean installation. I'll try further (I could not make original code public) |
Likewise, my application is large and proprietary. I'll try to find some time to dig deeper so I can provide more helpful information. |
WTF. How are we ending up with a CutStub in a property of the proxy class. |
@ianfp do you have any call to the VarDumper in your own code executed during this test ? And is the profiler enabled in your test environment (it also uses the VarDumper) ? |
VarDumper vs ProxyManager, that's going to be a fun issue /cc @Ocramius ;) |
@stof Yes! The profiler was enabled, and disabling it solves the problem! |
I have the profiler not enabled on the functional test, problem still exists. I've created a simple db update formular, to reproduce the error similar to my app which has the problem, without success. Everything works. Strange.... So, I give up try to reproduce the error on a clean installation. |
Would a heavily-redacted copy of my |
I can also confirm that the profiler has something to do with this issue since I've a functional test with $salesperson = $this->manager->getRepository(...)->findOneBy(['...' => '...']);
$crawler = $this->client->request('GET', '...');
$form = $crawler->selectButton('Sign In')->form();
$form['visitor_registry_sign_in[name]'] = $visitor = sprintf('Leeroy Jenkins %s', rand(10000, 99999));
$form['visitor_registry_sign_in[job_title]'] = 'Manager';
$form['visitor_registry_sign_in[company]'] = 'Acme';
$form['visitor_registry_sign_in[email]'] = 'john@mail.com';
$form['visitor_registry_sign_in[phone]'] = '0432123132';
$form['visitor_registry_sign_in[salesperson]'] = $salesperson->getId();
$form['visitor_registry_sign_in[purpose]'] = 'Personal';
$this->client->enableProfiler(); // line that causes the error (I've not investigated further)
$this->client->submit($form);
... |
Should be fixed by #23465 |
…f (nicolas-grekas) This PR was merged into the 3.3 branch. Discussion ---------- [HttpKernel][VarDumper] Truncate profiler data & optim perf | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23415, #21547 and hopefully #23110 and #23175 | License | MIT | Doc PR | - Commits ------- 754d3a7 [HttpKernel][VarDumper] Truncate profiler data & optim perf
@nicolas-grekas I'm sorry to report that I'm still seeing this on Symfony 3.3.5. |
@nicolas-grekas my problems are solved |
Please provide a reproducer. If this is something private and you'd be ok
to give me some temporary access, please contact me on Slack.
Le 21 juil. 2017 1:03 AM, "Ian Phillips" <notifications@github.com> a
écrit :
… @nicolas-grekas <https://github.com/nicolas-grekas> I'm sorry to report
that I'm still seeing this on Symfony 3.3.5.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23110 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAO32v7uGPQyb5Sm69EZwyh3uBgGXZMUks5sP9zagaJpZM4N0b6D>
.
|
Providing a reproducer does not seem to be feasible at the moment. But here's what I've discovered: The entity manager proxy in Before When my test finishes, it calls I hope that's of some help. |
Strange. Which exact PHP version do you have? |
on Ubuntu 16.04.2 LTS |
Can you check if the issue happens if you disable xdebug? |
Yes, the error occurs even if xdebug is disabled. |
Reproducer? |
My example is resolved by 3.3.5 |
I have the same issue as @ianfp. I'll try to provide a reproducer shortly. |
This is the minimum version to reproduce that I was able to achieve: https://github.com/ossinkine/symfony-standard/tree/issue-23110 |
I'm having this issue in Travis but have been unable to reproduce locally. |
Thanks @ossinkine for the reproducer. |
…der property (nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [Bridge/ProxyManager] Remove direct reference to value holder property | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23110 | License | MIT | Doc PR | - This fixes Ocramius/ProxyManager#394 on Symfony's side, because proxy-manager v1 is not maintained anymore, but is the only one that works on PHP 5.3/5.5, which we still support. Cannot be tested easily (but code is run by the existing test suite.) Commits ------- af9d644 [Bridge/ProxyManager] Remove direct reference to value holder property
Hey folks, I still lack a test case that reproduces the issue for:
If somebody can make an example that doesn't involve this hacky/invalid test case, please do let me know. Without a valid test case this won't be merged upstream. |
on the hackday's list for me :) |
I have the same issue:
|
@Invis1ble of course: it has been fixed in v3.3.11. |
@nicolas-grekas Thanks. I thought I had the latest version. |
I'm facing the same issue on my CI machine when upgrading from Symfony 5.4 to Symfony 6.2. My test also uses
Here is the relevant code from my test case: $client = $this->createWebClientByUsername('test');
// Enable profiler so we get sent email
$client->enableProfiler();
$client->request('POST', '/workshop/1', array(
'workshop_signup' => array(
'firstName' => 'Testing',
'lastName' => 'User',
'email' => 'test@testing.com',
'phone' => '12345678',
'userType' => WorkshopSignup::USER_TYPE_TEACHER,
'school' => null,
'georegion' => '7',
),
));
$this->assertResponseRedirects();
// Ensure one workshop registration email is sent
$mailCollector = $this->getMailCollector($client);
$this->assertEquals(1, sizeof($mailCollector->getEvents()->getEvents()));
// Ensure workshop Zoom URL is in the email message
/** @var Email $email */
$email = $mailCollector->getEvents()->getEvents()[0]->getMessage();
/** @var TextPart $textPart */
$textPart = $email->getBody();
$emailBody = $textPart->getBody();
$this->assertStringContainsString('https://us02web.zoom.us/j/1234567890?pwd=abcdefg', $emailBody);
$client->followRedirect(); // Line WorkshopShowControllerTest.php:292 in above stack trace @nicolas-grekas any idea? |
@nicodemuz I got the same issue like you after upgrading symfony |
This issue from 2 days ago is probably similar to #49091, which is caused by a PHP bug in PHP 8.1.0 to 8.1.7 (fixed in 8.1.8). Anyway, it is much better to create a new issue than commenting on a ticket closed 6 years ago (because your issue is likely not the same even if the error message is similar) |
I just upgraded from 3.2.x to 3.3.2, ran my test suite, and got this:
Inspecting the
CutStub
class reveals that, indeed, it does not have aclear()
method.The text was updated successfully, but these errors were encountered: