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  
bili
  • 395
  • 1
  • 6
  • 9

2 Answers2

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.

Krisztián Dudás
  • 856
  • 10
  • 22
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

Community
  • 1
  • 1
Arazu
  • 421
  • 2
  • 5
  • 15