When a candidate applies to a job an email notification is generated and the employer is sent the applicants email address and a link to their resume.
My installation is doubling up a part of url, below is the example.
What is happening; http://myservco.com/jared/jared/user/13
What should be happening; http://myservco.com/jared/user/13
Where is the extra "jared" coming from?
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 187417_jobsearch_wrongurl3.patch | 1.85 KB | xamount |
| #10 | 187417_jobsearch_wrongurl2.patch | 1.85 KB | xamount |
| #8 | 187417_jobsearch_wrongurl.patch | 1.65 KB | xamount |
Comments
Comment #1
lapith commentedThis is my first time working with Drupal and I am also relatively new to PHP in general, but this is the first module that I have been looking at to be used on a site that I am building. I too was having the problem that is described here and was able to find a solution. I am hoping that my solution proves valid and does not break other functionality that I am unaware of.
In the job.module there is a function: function theme_job_mail($job_node, $job_user, $resume_node, $resume_user)
This is the function that puts together the user readable e-mail. In the creation of the body variable you will find where the extra jared is coming from.
$body .= t("\nJob URL: @url", array('@url' => $base_url . "/node/$job_node->nid"));
If you compare the above code with yours you will note that I have taken out the call to the url() and have added a leading '/' to the url string. I just solved this problem and I have not yet done much research into the functionality of the url(), if I find any problems with my solution (or if you find any problems) please let me know.
Comment #2
lapith commentedI actually just did a bit more research into the url() and I believe that I found an even better solution to our problem:
As seen in the drupal documentation (http://api.drupal.org/api/function/url/5) there is built in functionality in the url() that will allow us to force an absolute link which is exactly what is needed here! Check out the revised code:
$body .= t("\nJob URL: @url", array('@url' => url("node/$job_node->nid", NULL, NULL, TRUE)));
Also I hate to go on a tangent but I tried to recreate this theme function in my template.php file (naming it mythemename_job_mail) but it did not seem to override the existing function, is this not the correct place to override? I had to actually edit my module code, which I know is not the desired method.
Comment #3
iaminawe commentedI can confirm that this is an issue. Only applying the line of code above didn't work for me. Any ideas why?
It seems like a pretty serious issue as having the employer click in the link in the e-mail to view the job hunters resume is a crucial link to be correct.
At current it puts a double version of username and breaks the link after the main url in the e-mail so the link is not clickable.
Thanks
Comment #4
magoo commentedThis is a bug and is also present in the 5.X-2.0 version of the module.
The code used in that version is:
why don't we "simply" use the base of the site and just add the job_node related part after ?
--
magoo
Comment #5
Andy Galaxy commented#1 Worked for me.
Peace,
Andy
Comment #6
kbahey commentedCan someone submit a working patch, so the module contains the fix?
Comment #7
iaminawe commentedYes Please... a patch would be appreciated
Comment #8
xamountI have attached the patch to fix this issue. I have tested on with both clean urls on and off. community feedback would be appreciated.
Comment #9
kbahey commentedInstead of using $base_url, you can remove it and use the option to make it absolute, like so:
Makes the code more compact.
Comment #10
xamountnew patch attached.
Comment #11
kbahey commentedI assume you tested it and it does the same. Right?
If so, then it is good to go, after you change null to NULL as per code style.
You can commit it. Make sure you checkout DRUPAL-5--2 and commit to it.
For a separate issues, you can run the module thru the coder module to fix all code styles in one go.
Comment #12
xamountYes I have tested it. I have attached the final patch.
cvs access is blocked at my current location, so I'll commit it a little later. I found some other issue when I ran the coder module. I'll open a separate issue for that....its nothing critical though....just style issues.
Comment #13
kbahey commentedLooks good.
Go ahead and commit it to the DRUPAL-5--2 tag.
Comment #14
xamountcommited