CRM-2153 Tell a Friend functionality for Online Contributions and Event Registration

    Details

      Description

      Complete specification is on the wiki at:

      http://wiki.civicrm.org/confluence/display/CRM/Tell+A+Friend

        Attachments

        1. screenshot-1.jpg
          109 kB
          Emily Frazier
        2. tellfriend_anonymous.jpg
          71 kB
          David Greenberg

          Activity

          [CRM-2153] Tell a Friend functionality for Online Contributions and Event Registration
          Kurund Jalmi added a comment -

          transferring for QA

          David Greenberg added a comment -

          CRM-2153 QA
          ============

          • setDefaulttValues (CRM/Friend/Form/Contribute.php and Event.php)
          • default strings for intro, suggested_message etc must be wrapped in ts() !!!
          • Why isn't the condition for initialing title, intro etc. an "else" on if( isset($this->_id) - e.g. this is a new tell_friend record?? Is there a case where we have a saved record and we still should supply defaults?
          • intro field on the admin (config) form currently is stripping out HTML tags. Per the spec, it should allow tags so the admin can include formatting in this block.
          • Link to Tell a Friend page from Contribution Thank-you page is not placed correctly per spec (it's currently at the bottom of the page):
            "The link TO this form should be placed prominently in the Thankyou Page just below the Thankyou_text." We also need to style it to make it more prominent. Let's try putting it in a status message box with a larger font.
          • Emails to friends:
          • We need to include the friends' names in the TO of the email address (currently we're only passing the email address).
          • Activity inserts in postProcess for the End-user Tell-a-friend submit are incorrect:
          • Activitiy type id s/b 9 not 14
          • For each form submit, there should be ONE civicrm_activity record and N activity_target records where N = the number of friends' emails sent (e.g. one for each recipient). In my test, I filled in 2 rows (2 friends) and postProcess created TWO activity records, and only the second activity record had a corresponding activity_target record.
          • Currently, I'm getting these status messages after "telling my friends". This is not appropriate for the end-user. I think the admin-supplied thank-you message is sufficient. Hopefully, if this is coming from the Activity BAO - there's a parameter to suppress it.

          "Activity "Tell a Friend:Help Support CiviCRM!" has been saved. Activity "Tell a Friend:Help Support CiviCRM!" has been saved."

          Kurund Jalmi added a comment -

          Transferring for QA fixes

          David Greenberg added a comment -

          Everything is resolved now EXCEPT we need to make the Tell a Friend form accessible to any user with "make online contributions" or "register for events' permission - including Anonymous if those permissions are assigned.

          NOTE: Currently, in my Drupal install i get Access Denied for Online Contrib and Event Reg pages when I'm not logged in - despite the fact that my Drupal Access Control settings allow anonymous access to those functions.

          Donald A. Lobo added a comment -

          permissions is now fixed. I also froze the from name / from email to avoid anyone hijacking the form for their spam purposes. I looked at the code and dont think they were used anyway

          We need a valid contactID in the session for this to work. The contribute and event forms now add a contactID to the session which needs to be present etc. I think this is good and also another small deterrent in making this an open spam relay

          David Greenberg added a comment -

          Re-arranged Form.tpl given that FROM is read-only. Permissions are working.

          Please re-test this feature for Event Registration during QA cycle (event registration was broken when I tested - so couldn't reverify this feature).

          Manish Zope added a comment -

          Verify for 2.0

          Emily Frazier added a comment -

          In beta version 5 with Drupal it appears the permissions are not working for this feature. I have anonymous users allowed to "make online contributions" and "register for events". Event registration works fine, but clicking the "tell a friend link" as anonymous brings me to an access denied page. Would verify this on demo but can't access CiviEvent when logged in as demo user.

          Emily Frazier added a comment -

          CiviEvent is back on the demo and I was able to verify this permissions error is happening there. Event registration works fine for an anonymous user, but if I click "Tell A Friend" link on the event confirmation page, I get an access denied error. Screenshot of CiviCRM Demo site access denied screen is attached.

          David Greenberg added a comment -

          I just tried this on demo, using the Fall Fundraiser Dinner event in test-drive mode. Starting URL was:

          http://drupal.demo.civicrm.org/civicrm/event/register?reset=1&action=preview&id=1

          I was not logged in to Drupal (anonymous). I was able to click the Tell a Friend link and successfully load (and subsequently submit) the Tell a Friend form at this URL:

          http://drupal.demo.civicrm.org/civicrm/friend?eid=1&reset=1&action=preview&page=event

          I've attached a screenshoot showing that form loaded. You can see in the screenshot that I'm NOT logged in - since the "login" or "create account" prompts are shown in the left column.

          Emily - Please give us exact steps / urls that you are using when you get Access Denied on the demo. This is quite puzzling (esp since the permissions specified in the code - CRM/Core/Menu.php lines 285-6 specifically permit the friend URL if either "make online contributions" OR "register for events" is true) ???

          Emily Frazier added a comment -

          I got the access denied by creating a new event and then trying to "tell a friend" for that event once I registered as an Anonymous user. I just double-checked and had the same thing happen. The event I was testing with is called "test event", and the link to start is here:

          http://drupal.demo.civicrm.org/civicrm/event/info?reset=1&id=8

          After registering, I click the "tell a friend" link, and that's when I get access denied. The registration works fine, and Tell a Friend section is enabled.

          I notice that if I try to do a "test-drive" on this event, when I click Tell a Friend it gives me a
          "Sorry. A non-recoverable error has occurred.
          Could not get the contact ID"

          I am not using any profile fields with this test event; it's just an email address field for the registration. It is also a free event.

          I also tested another event that does have fees associated with it. Here is another one that gives access denied when telling a friend:
          http://drupal.demo.civicrm.org/civicrm/event/info?reset=1&id=5

          And when test-driving that event, I get the same error if I click "tell a friend".

          David Greenberg added a comment -

          Please check Emily's cases on demo, figure out why we're getting inconsistent results and fix.

          Sunil Pawar added a comment -

          fixed in r13618

          Sunil Pawar added a comment -

          For unpaid event we skip middle step and directly jump to last step. While implementing this functionality we didn't set contact id correctly, hence there was error mentioned above. This is now fixed.

          Matt Rice added a comment -

          I'm getting the same error. I've noticed that the tell a friend link is actually:

          civicrm/tell_a_Friend

          while the permissions check in menu.php is:

          'path' => 'civicrm/friend',

          David Greenberg added a comment -

          Matt - That is an invalid link - which WAS being generated in 2.0.0 for the case when the Event is NOT Paid. This was fixed on March 11 (r13618) - and I just verified that is working properly on demo. The fix "should" be included in 2.01 (the current stable distribution on SourceForge) since that was generated on March 13.

          If you are getting this while running 2.01 - please see if you can replicate on the public demo site which is running the latest rev of 2.0 (soon to be packaged as 2.02). If so, post back here with exact steps to replicate.

          Matt Rice added a comment -

          David.

          I downloaded and installed the evening of March 13, I have 2.0.1 but am unsure of the build #, if there is one.

          Not sure how to test on the demo site without being able to create a new event?

          I was able to see the same screen as your screenshot on your installation, but I believe it is because you are re-directed to the correct URL, my install is not re-directed to the correct url, but to the one that I stated above.

          I have a paid event, processed through authorize.net, after the transaction is complete the Tell a friend link refers the user to the wrong URL

          David Greenberg added a comment -

          Matt - The fix for this should be included in 2.0.1. The symptom of the problem is that the actual link path is wrong (as you noted above):

          civicrm/tell_a_Friend (incorrect link)
          civicrm/friend (correct link)

          If you're using 2.0.1 and still getting that bad link, then it's some combination of how the event is configured. You have the ability to create new events on the Drupal demo (http://drupal.demo.civicrm.org) - so it would be great if you could set up an event exactly like the one that's giving this bad link.

          Matt Rice added a comment -

          Can't duplicate on your demo site, as I can't setup a dummy authorize.net payment processor

          Matt Rice added a comment -

          Quick find through dreamweaver found this:
          $url = CRM_Utils_System::url("civicrm/tell_a_friend",

          on line 117 in civicrm/CRM/Event/Form/Registration/ThankYou.php

          I assume that should be civicrm/friend

          -Matt

          Matt Rice added a comment -

          BTW: I downloaded another copy of CiviCRM, opened the above mentioned file and it has the wrong link in it. Once there is a valid payment processor on the demo site I can duplicate I am sure of it.

          Donald A. Lobo added a comment -

          This is fixed in svn and will be part of the 2.0.2 release early next week. Can you change the url to friend and see if it works

          Matt Rice added a comment -

          I changed line 117 in civicrm/CRM/Event/Form/Registration/ThankYou.php to reflect the correct URL, and all works fine.

          Matt Rice added a comment -

          I wish there was a way to edit my comments, I'm don't like posting multiple. I forgot to say thanks, Thank you.

            People

            • Assignee:
              mari tilos
              Reporter:
              Michał Mach

              Dates

              • Created:
                Updated:
                Resolved: