-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Catchable Fatal Error: Argument 1 passed to AttributeBag::initialize() #23175
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
Well, |
This is an snippet for apache_error.log
@stof the only weird thing that I did, was get logged in with the same user in another browser. If I open the site in an incognito window, it works |
@nicolas-grekas looks like we have another case where a Stub is leaked to the original value (and I don't think this one involves ProxyManager, unlike #23110) |
@anacona16 can you post the full stack trace please? |
And also the first exception (your excerpt says 2/2. What is 1/2?) |
@nicolas-grekas let me know if this help you. Thanks
|
Hi: I have the same issue:
|
I'm having the same issue, I did some research so just a bit more info in case it helps to fix it: In my case, this can be replicated when assigning an undefined var (misspelt it) to 'choices' on a ChoiceType. It crashes without printing an error, and I get on apache:
Then, 3 keys are set in the session, and you get the message that @anacona16 posted. |
Hi! Some errors...
got error
Symfony\Component\VarDumper\Cloner\Stub |
Hi, I have the same problem request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Catchable Fatal Error: Argument 1 passed to Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::initialize() must be of the type array, object given, called in /var/www/html/var/cache/dev/classes.php on line 248 and defined" at /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php line 57 {"exception":"[object] (Symfony\Component\Debug\Exception\ContextErrorException(code: 0): Catchable Fatal Error: Argument 1 passed to Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::initialize() must be of the type array, object given, called in /var/www/html/var/cache/dev/classes.php on line 248 and defined at /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php:57)"} [] |
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
I am getting the same error `Symfony\Component\Debug\Exception\ContextErrorException: at vendor\symfony\symfony\src\Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag.php:57 The given fix #23465 does not work for me. Also I am unable to understand the fix. I am on symfony 3.3. Can anyone help? |
Are you on 3.3.8? |
Composer.json says |
what does |
here is the output of composer show : |
Here is my ProductType.php: `<?php namespace AppBundle\Form\Type; use Symfony\Component\Form\AbstractType; class ProductType extends AbstractType {
} And my Controller:
|
It would be great to read to output yourself... |
Just try to upgrade to > 3.3.6. This problem has been fixed now by these
great guys.
El 1 sept. 2017 19:14, "utkarsh2k2" <notifications@github.com> escribió:
… Here is my ProductType.php:
`<?php
namespace AppBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class ProductType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->add('price');
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
$product = $event->getData();
$form = $event->getForm();
// check if the Product object is "new"
// If no data is passed to the form, the data is "null".
// This should be considered a new "Product"
if (!$product || null === $product->getId()) {
$form->add('name', TextType::class);
}
});
$builder->add('save', SubmitType::class, array('label' => 'Submit'));
}
// ...
}
`
And my Controller:
/**
* @route("/product", name="productpage")
*/
public function productAction(Request $request) {
$product = new Product();
$form = $this->createForm(ProductType::class, $product);
$form->handleRequest($request);
//check for validation
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
//save the $candidate object into database
$em->persist($product);
$em->flush();
//redirect to success page
return $this->redirectToRoute('successpage');
}
return $this->render('default/product.html.twig', array(
'form' => $form->createView(),
));
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23175 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQFsbCIgOI3k4g0jP51F6Hh_uf1QlsHnks5seDuFgaJpZM4N6DSX>
.
|
ok will try that |
ok I just ran |
Btw, clearing cookies help to get rid of this problem. |
Hey, I have some errors in PHP database registration query. Line 42 to 51 ->
Line 158-165 |
Uh oh!
There was an error while loading. Please reload this page.
Sometimes I'm getting this errors, it started happen after update to Symfony 3.3.2.
$ composer show
The text was updated successfully, but these errors were encountered: