Undefined Variable when Variable Exists
-
We have inherited a wordpress website from another developer and I am having issues with a plugin that was created by the previous developer (assistance from them is pretty much a no no), the live version of the website that is still at the previous host works correctly see here but throws the following error on the development website we have migrated to:
Notice: Undefined variable: job in /home/sites/4b/5/52834f6c40/public_html/wp-content/themes/carreras/careeras/page-blank.php on line 39
I used kint debugger to check on job and it is returning null, the changes made since we transferred have been to update the database connection details and to remove an undefined character from the start of the class file as it was causing a headers already sent error.
As you can see on the demo website the jobs list does show up, the problem occurs when trying to view a single job, does anybody have any ideas what is going wrong?
the query:
global $wp_query; if($wp_query->get('job')){ $job = Pureblue_Cla_Integration_Public::get_single_job($wp_query->get('job')); // Now deal with the 'blank Industry Area' if ($job['description']=='')$job['description']="Any Industry"; }
line 39:
<p class="descr"><?php echo $job['description']?></p>
the function:` public static function get_single_job($id) {$job = ORM::for_table(‘jobs_ol’)->where(‘job_ref’, (int) $id)
->join(‘consultant_ol’,array(‘job_consult’, ‘=’, ‘consultant_ol.consult_ref’))
->left_outer_join(‘list_2_ol’, array(‘job_list_2’, ‘=’, ‘list_2_ol.list_ref’))
->find_one();
return $job;}`
The page I need help with: [log in to see the link]
- The topic ‘Undefined Variable when Variable Exists’ is closed to new replies.