Download & Extend

Job_Posting Module unlocked for Anonymous Users

Project:Job Posting
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi all,

This was a big issue on job posting module that there was no support for anonymous users. After struggling a lot I found the way to battle with this problem. Here is a few changes that you have to make .module file in job_posting module...

1. In function job_posting_application_form replace

$form['job_posting_applicant'] = array(
'#type' => 'item',
'#title' => t('Applicant'),
'#value' => $user->name .' <'. $user->mail .'>',
'#maxlength' => 64,
);
with
$form['job_posting_applicant'] = array(
'#type' => 'textfield',
'#title' => t('Applicant'),
'#value' => '',
'#maxlength' => 64,
);

2. Replace function
function job_posting_application_form_page($node_id) {
// forward to job listing page an application form is requested
// for a nid that is unpublished, information-only or otherwise
// expired or invalid
$query = 'SELECT COUNT(*) FROM {node} n INNER JOIN {job_posting} p
ON n.nid = p.nid
WHERE p.nid = %d
AND n.status = 1
AND p.applink = 1
AND (p.deadline > %d OR p.expires = 0)';
if (db_result(db_query($query, $node_id, _job_posting_gmt()))) {
//retrieve node info for job_posting being applied to
$node = db_fetch_object(db_query(
'SELECT n.nid, n.title, p.email AS job_posting_email
FROM {node} n INNER JOIN {job_posting} p
ON n.nid = p.nid
WHERE n.nid = %d', $node_id)
);
return drupal_get_form('job_posting_application_form',
array($node->nid, $node->title, $node->job_posting_email));
}
drupal_goto('jobs');
}

with

function job_posting_application_form_page($node_id) {

return drupal_get_form('job_posting_application_form',
array($node->nid, $node->title, $node->job_posting_email));

}

And your module will be unlocked for anonymous users...

Thanks

Divesh Kumar

Comments

#1

Category:bug report» feature request

not a bug report -- changing to more appropriate category

#2

did not work for me...

#3

Please see this similar post with an attached workaround (version 6.x-1.10):
http://drupal.org/node/391756

#4

nope, did not work.

#5

Status:active» closed (fixed)

#6

See this update:

http://drupal.org/node/391756#comment-5048160

Includes:
Replacement file for job_posting-6.x-1.11
Install instructions
Working demo

nobody click here