Job Resume List Content Type Bug

Rob Loach - May 22, 2007 - 19:03
Project:Job Search
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

In job.module, there's a function named job_resume_list that queries the database for all resumes of a given user. Although it does work if your resume type is named "resume", it doesn't work if you have it set to something else, like "personalinfo". Since you can select the resume type at admin/settings/resume, I think that it should tailor to whatever you picked as your resume type. The line is at:

<?php
  $result
= db_query("SELECT n.nid, n.title, n.changed FROM {node} n WHERE n.type = 'resume' AND n.uid = %d", $uid);
?>

... in the job_resume_list function. Instead of querying for 'resume', it should search for: variable_get(RESUME_NODE_TYPE . $type, 'resume') .

This would turn the line into:

<?php
  $result
= db_query("SELECT n.nid, n.title, n.changed FROM {node} n WHERE n.type = '" . variable_get(RESUME_NODE_TYPE . $type, 'resume') . "' AND n.uid = %d", $uid);
?>

... I believe. Thanks a lot, and keep up the great work on this module!

#1

kbahey - May 23, 2007 - 19:43
Status:active» postponed (maintainer needs more info)

Can you please submit this as a proper patch?

See http://drupal.org/patch

#2

Liliplanet - March 13, 2008 - 17:20

I've got the same problem as I use nodeprofile and usernode. And as my content type 'profile' is connected to both, have 2 listings that are incorrect.

function job_resume_list($uid) {
  $resume_types = array();
  foreach(node_get_types() as $type => $name) {
    if (variable_get(RESUME_NODE_TYPE . $type, 0)) {
      $resumes_types[] = "'". $type ."'";
    }
  }
if (!count($resumes_types)) {
    return array();
  }

I would just like 1 type please, the content type is called 'profile'.

Look forward to your reply.

Lilian

#3

Rob Loach - March 14, 2008 - 13:53

Hi Khalid... Sorry I didn't submit a patch when I could've. Not too sure where the code is now...

#4

kbahey - March 14, 2008 - 15:19
Status:postponed (maintainer needs more info)» needs work
 
 

Drupal is a registered trademark of Dries Buytaert.