Page 1 of 1

Email us feature in 3.21 not working?

PostPosted: Mon Oct 03, 2011 11:52 am
by k.rimkus
We have Archon 3.21 running on a test server and would like to make the switch from 3.14, but the "email us" feature doesn't seem to work. Are there any particular settings which must be in place for this feature to work? In our current installation, I receive an on-screen "confirmation" that an email has been sent after sending the form, but do not receive any email confirmation (either to my sender or repository addresses). I tried making a request in the Sandbox as well, and didn't receive an email confirmation of having sent a request (as in previous versions of Archon). Is this a bug or a settings issue?

Kyle Rimkus
Head of Digital Scholarship and Programs
University of Miami Libraries

Re: Email us feature in 3.21 not working?

PostPosted: Wed Oct 19, 2011 12:33 am
by paulnsorensen
I'll have to take a look at it and get back to you.

Re: Email us feature in 3.21 not working?

PostPosted: Tue Nov 29, 2011 3:29 pm
by k.rimkus
Hi Paul,

That would be great if you could. In the meanwhile, I've replaced our packages/collections/pub/research.php file in our 3.21 instance with the analogous file from the 3.14 release. Now the email feature is working for us. I understand that 3.21 has an enhanced email feature that routes emails to specific repositories, and we'd love to be able to make use of it, but haven't managed to troubleshoot the source code to see why exactly it isn't working for us right now.

Thanks,

Kyle
Head of Digital Scholarship and Programs
University of Miami Libraries

Re: Email us feature in 3.21 not working?

PostPosted: Fri May 11, 2012 3:35 pm
by gjerdery
We also see the issue that email doesn't sent in 3.21. While the user sending the email gets an affirmative message on the Archon page, there is no record in the mail logs for the server of sent mail.
Reverting to the file from 3.14 allows the email to be sent, along with a confirmation email to the sender.
Version 3.20 of research.php also doesn't work.

Re: Email us feature in 3.21 not working?

PostPosted: Mon Jul 09, 2012 8:34 am
by gjerdery
I believe I've fixed this bug in our local instance. I've asked my repository managers to do little testing to confirm, and if that comes back positive, I'll commit to the GitHub repository.

*** I spoke too soon... my "fix" from this morning isn't a true fix. I'll update in the morning with v. 2 of a fix.

Re: Email us feature in 3.21 not working?

PostPosted: Tue Jul 10, 2012 10:09 am
by gjerdery
I believe I've found the solution to this, and will post the code to GitHub. Here's what I found. Ultimately, the "Contact Us" form tries to send email via /packages/collections/pub/research.php. Line 539 is the start of the case statement relevant to this issue. It appears that when a user was attempting to send email but had no items in their cart, the $arrDetails var at the start of this case was being set as an empty array, causing the following foreach condition to never be met. So, I added a check to see if that var was !empty, and provided an alternative call to sendEmail() if it was empty.

Here's the new code, which replaces what was found in lines 542-545:
if(!empty($arrDetails))
{
foreach($arrDetails as $RepositoryID => $details)
{
$_ARCHON->sendEmail($_REQUEST['fromaddress'], $_REQUEST['message'], $_REQUEST['referer'], $_REQUEST['fromname'], $_REQUEST['subject'], $_REQUEST['fromphone'], $_REQUEST['details'] . '\n\n' . $details, $_REQUEST['detailsfunction'], $_REQUEST['detailsparams'], $RepositoryID);
}
}
else
{
$_ARCHON->sendEmail($_REQUEST['fromaddress'], $_REQUEST['message'], $_REQUEST['referer'], $_REQUEST['fromname'], $_REQUEST['subject'], $_REQUEST['fromphone'], $_REQUEST['details'], $_REQUEST['detailsfunction'], $_REQUEST['detailsparams']);
}

Re: Email us feature in 3.21 not working?

PostPosted: Tue Jul 10, 2012 2:49 pm
by paulnsorensen
Good catch.

Re: Email us feature in 3.21 not working?

PostPosted: Mon Sep 17, 2012 12:29 pm
by otsymbal
I changed the code in line 542-545 (the way GJERDERY suggested); however, the ‘contact us’ form did not work. Yet, when I substitute the file research.php 3.21 with research.php 3.14; the ‘contact us’ form started to work. I am wondering, if old version of the file can have a negative affect for anything? Also, I would like to know if someone could post the working file research.php 3.21

Thanks in advance

Re: Email us feature in 3.21 not working?

PostPosted: Mon Sep 17, 2012 2:31 pm
by gjerdery
Here's the page in the GitHub repository for the project that contains a copy of research.php: https://github.com/archonproject/archon ... search.php

Right click on the "Raw" button and save a copy of the file to grab just this file.

Re: Email us feature in 3.21 not working?

PostPosted: Thu Sep 20, 2012 10:56 am
by otsymbal
Dear gjerdery,
Your help is greatly appreciated.

;)

Re: Email us feature in 3.21 [it is still not working]

PostPosted: Fri Sep 21, 2012 3:06 pm
by otsymbal
Dear gjerdery,
First of all, thank you so much for your support.
I replaced the research file with the one that you suggested and tested with Chrome, Firefox, and Internet Explorer. Three browsers are working perfectly when there is no cart item. However, when I have anything in the cart Firefox, and Internet Explorer are not working. I deleted cookies, restart the browser, and still getting the same problem.

Your help is greatly appreciated,
;)

Re: Email us feature in 3.21 not working?

PostPosted: Thu Nov 29, 2012 6:14 pm
by cnelson
Is there an update on this issue? We are having the same problem and before I go trying to replace the files or anything I thought I should ask if this fix has been included in the 3.21-rev1 patch? Thanks,

CNelson

Re: Email us feature in 3.21 not working?

PostPosted: Fri Nov 30, 2012 4:29 pm
by prom
It has not been included in r-1. We will probably need to do at least one more update to archon, and r-2 since there are several other outstanding issues. In the meantime, please grab the file from github.

Chris