hi,

i love this module, but, the resume nodes are showing up in search results,

i think patches are required for the drupal 4.7.3 node.module, to exclude
the 'resume' node type from being indexed by the search module.

any ideas?

CommentFileSizeAuthor
#2 job.module.patch955 bytesklance
#5 resume.module.patch977 bytesklance
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drupalgirl’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

Has this issue been dealt with? Please let users know if still represent a security issue for the resume poster.

klance’s picture

Status: Needs work » Active
FileSize
955 bytes

I'm glad I looked at this bug report, because I didn't realize it was doing that. One of my modules was doing the same thing, and I had to implement hook_db_rewrite_sql to overcome this problem. In this case it would look something like this:


/*
 * Implementation of hook_db_rewrite_sql().
 */
function job_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
  switch ($primary_field) {
    case 'nid':
      // this query deals with node objects
      $return = array();
      if (!user_access('view resumes')) {
        if ($primary_table != 'n') {
          $return['join'] = "LEFT JOIN {node} n ON $primary_table.nid = n.nid";
        }
        $return['where'] = "n.type <> 'resume'";
        return $return;
      }
      break;
    case 'tid':
      // this query deals with taxonomy objects
      break;
    case 'vid':
      // this query deals with vocabulary objects
      break;
  }
}

klance’s picture

Status: Active » Needs review
kbahey’s picture

Status: Needs review » Needs work

@klance

There are two modules included with the job search module for node access stuff.

Can you please check if your function should go into the resume_access or job_access module rather than the main? Also please test the results with the new change for regression (current access permissions are not affected).

Thanks

klance’s picture

FileSize
977 bytes

Cut the code from job.module and paste it into resume.module. Same effect, more appropriate location.

klance’s picture

Status: Active » Needs work

Yeesh... that gets it out of the search results, but it causes an SQL error that prevents views from showing up. Oh well...