I have problem with my Symfony2 project. On the localhost it works fine, but on the server I got that error:
"Catchable Fatal Error: Argument 1 passed to
Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::initialize()
must be of the type array, string given, called in
/home/visset/ftp/cms/dashboard/app/cache/dev/classes.php on line 252
and defined"
I checked it and to initialize() function passed empty string.
What is the reason of that problem?
Related
I have this error when trying to deserialize JSON data:
Uncaught Error: Argument 2 passed to
JMS\Serializer\Metadata\Driver\AbstractDoctrineTypeDriver::__construct()
must be an instance of Doctrine\Common\Persistence\ManagerRegistry,
instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in
/var/www/mda-api/var/cache/prod/ContainerXJGxuAr/getJmsSerializer_MetadataDriverService.php
on line 13
$result = $this->serializer->deserialize(
$encoder->encode($jsonContent,'json'),
Client::class,
"json",
);
Does anyone have any idea why this error happen?
I am creating the child theme of twentythirteen. It works fine in localhost without any error but when I put live on the server I got the following error
Warning: call_user_func_array() expects parameter 1 to be a valid
callback, function 'parent_theme_locations' not found or invalid
function name in
/home/nonaitpub/public_html/subedi/wordpress/wp-includes/plugin.php on
line 496
I think you had called function 'parent_theme_locations' somewhere in your functions.php file.Like add_action('after_setup_theme','parent_theme_locations',20);
I changed a table name from 'match' to 'matchGame'. Then I edited all of my code so that matchGame was used everywhere. I then used the commands doctrine:import and generate:entities to update all the things for the database. However if I run my program now I get following error:
[Symfony\Component\Debug\Exception\ContextErrorException]
Catchable Fatal Error: Argument 1 passed to Login\LoginBundle\Entity\Tactic
s::setMatchMatchid() must be an instance of Login\LoginBundle\Entity\Match,
instance of Login\LoginBundle\Entity\Matchgame given, called in C:\wamp\ww
w\SocProNetbeans\src\Login\LoginBundle\Command\CreateSeasonCommand.php on l
ine 73 and defined in C:\wamp\www\SocProNetbeans\src\Login\LoginBundle\Enti
ty\Tactics.php line 632
What adjustment do I need to do to change this?
It looks like you've not changed the name of your Match entity class.
I am using CakePHP 2.X latest. Facing unique error.
This is error i am getting:
Warning (2): call_user_func_array() expects parameter 1 to be a valid
callback, first array member is not a valid class name or object
[CORE/Cake/Utility/ObjectCollection.php, line 132]
Warning (2): call_user_func_array() expects parameter 1 to be a valid
callback, first array member is not a valid class name or object
[CORE/Cake/Utility/ObjectCollection.php, line 132]
Fatal error: Call to a member function link() on a non-object in
/data/html/savaganza/app/View/Elements/header.ctp on line 21
I am simply using Html in my header element
Line 21: <?php echo $this->Html->link('Categories', array('controller'=>'categories') ); ?>
This Header element is calling from all views this is giving me error for some view, i don't know why but its working fine for some views.
Efforts:
When i change $this->Html to $this->html it works why???
When i tried var_dump($this->Html) it gives string(58)
"�H��.
Its working in my loacal server but not in live server.
Suggest me please.
May be this question link to Weird PHP error: 'Can't use function return value in write context'
Perfect Answer: Because empty is not a function but a language construct (not sure), and it only takes variable
but when i change this line:
$des = (!empty(html_entity_decode($c['Coupon']['description'])))?html_entity_decode($c['Coupon']['description']):'Not Avaliable';
to
$des = html_entity_decode($c['Coupon']['description']);
$des = (!empty($des)) ? $des : 'Not Avaliable';
It works i don't know exact reason. Hope somebody help me to understand this.
I am new to opencart, so please help me.
I am using opencart version 1.5.6, now whenever I edit and delete the product it shows me
Fatal error: Call to a member function productUpdateListen() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 78
and
Fatal error: Call to a member function deleteProduct() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 133 respectively.
Although it edit and delete the product.
Please help me how to fix it.
Code in Line 78 $this->openbay->productUpdateListen($this->request->get['product_id'], $this->request->post);
And code in line 133 $this->openbay->deleteProduct($product_id);
This means $this->openbay is not an object which contains function productUpdateListen() & deleteProduct(), probably it's NULL or false in some cases (nothing found) due to it's not accessible. Out of scope.
Try
var_dump($this->openbay);
Check the O/P
it's simple and the error-message says it all: your $this->openbay doesn't have those methods (productUpdateListen() and deleteProduct()) - most likely it isn't an object at all.
please debug your code since it's impossible to say what's going wrong wich so little information. to start, do a var_dump($this->openbay); right before the function-calls and check the output.