0

i'm working on symfony1 project and i get this exception. anybody have an idea on what is causing it ?

Notice: Array to string conversion in C:\wamp\www\gazette\apps\GAZ\modules\jobAppliance\actions\actions.class.php on line 1183

public function executeSaveCandidateJsni()
{
$jobId = $this->getRequestParameter('job_id');
$job = JobPeer::retrieveByPK($jobId);

// Sauvegarde des objets jobAppliance et de jobApplianceAttachedFile
$listJApplianceAttachedCV = $this->getUser()->getAttribute('list_job_appliance_attached_cv');

// ***this is line 1183*** 

sfContext::getInstance()->getLogger()->debug('(Jsni) $listJApplianceAttachedCV = ' .$listJApplianceAttachedCV); // ***this is line 1183*** 

$listJApplianceAttachedFile = $this->getUser()->getAttribute('list_job_appliance_attached_file');
sfContext::getInstance()->getLogger()->debug('(Jsni) $listJApplianceAttachedFile = ' .$listJApplianceAttachedFile);  // 

$listDetailForm = $this->fillTableWithValueFromFormJsni();
$this->saveJApplAndJApplAttFileJsni($job, $listJApplianceAttachedCV, $listJApplianceAttachedFile, $listDetailForm);
// End Sauvegarde


//  ... rest of the code  
1
  • Can you show the code with the corresponding call to setAttribute for list_job_appliance_attached_cv? Commented Oct 5, 2014 at 17:31

2 Answers 2

0

As it said, you want to concatenate a string with an array. Use var_dump to output the value of $listJApplianceAttachedCV. I don't really know symfon1 or 2, I only do some practicing in 2 but if php says you want to use an array as a string, it must be right and you should really check what is the value of your variable before falling into despair.

Sign up to request clarification or add additional context in comments.

Comments

0

Its good practice to check the type of your variable, before throwing it directly into a string. It seems you have set an array in the users session. See more documentation about getAttribute method

If you want the array as string, use 'implode'

Usage of implode for a multidimensional array

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.