CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
Pages: [1]

Author Topic: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?  (Read 3089 times)

adrianharvey

  • Guest
UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 22, 2009, 01:33:19 pm
OK - I have done a bit of work on this and now it is beyond me, but if I am correct then neither the OptOut or Unsubscribe URL links work in 2.2.1 (the version I am currently on).

The issue also shows up when using the standalone forms for registering for a Mailing Group - which also doesn;t work.

The user gets redirected back to the site home page, and no database actions are completed.
+++

However.  If you access the profile signup URL, (rather than the standalone form), everything starts to work.
If you then clear the cookies, everything stops working again...

My conclusion so far, is that there are some needed session variables for OptOutURL, UnSubscribeURL and the post form for the standalone profile signup. - These are not generated when accessing the URL directly, and thus fail.

The system signup form must generate these variables (I guess for it's own form to work) and thus the other URL commands start to work.

Any comments from those that know?

Yours pretty desperately :-)
Adrian


adrianharvey

  • Guest
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 22, 2009, 02:23:37 pm
Some more:

It's a session issue:


I put a 'die' into the frontend civicrm.php (yes this is Joomla).  as below.

Code: [Select]
function civicrm_invoke( ) {
    civicrm_init( );

    // check and ensure that we have a valid session
    if ( ! empty( $_POST ) ) {
        if ( count( $_SESSION ) <= 1 ||
             empty( $_SESSION['CiviCRM'] ) ) {
            require_once 'CRM/Utils/System.php';
die("j");
            $config =& CRM_Core_Config::singleton( );
            CRM_Utils_System::redirect( $config->userFrameworkBaseURL );
        }
    }


The are you sure you want to unsubscribe page gets rendered, but the submit doesn;t get past the session check.

Also - If I remove the name/value pair from the submit part of the form, it passes the session ok.
Code: [Select]
<input type="submit" name="_qf_unsubscribe_next" value="Unsubscribe" class="form-submit" />
Adrian

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 22, 2009, 06:53:16 pm

can you do a

print_r( $_SESSION );

before the die( );

also u r using joomla 1.5.x, right?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adrianharvey

  • Guest
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 22, 2009, 11:58:30 pm

Yep:

This is what is looks like.

Code: [Select]
Array ( [__default] => Array ( [session.client.browser] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729) [session.counter] => 3 [registry] => JRegistry Object ( [_defaultNameSpace] => session [_registry] => Array ( [session] => Array ( [data] => stdClass Object ( ) ) ) [_errors] => Array ( ) ) [user] => JUser Object ( [id] => 0 [name] => [username] => [email] => [password] => [password_clear] => [usertype] => [block] => [sendEmail] => 0 [gid] => 0 [registerDate] => [lastvisitDate] => [activation] => [params] => [aid] => 0 [guest] => 1 [_params] => JParameter Object ( [_raw] => [_xml] => [_elements] => Array ( ) [_elementPath] => Array ( [0] => /home/****admin/public_html/libraries/joomla/html/parameter/element ) [_defaultNameSpace] => _default [_registry] => Array ( [_default] => Array ( [data] => stdClass Object ( ) ) ) [_errors] => Array ( ) ) [_errorMsg] => [_errors] => Array ( ) ) [session.token] => 5018e562d59f46cc61873bc73c61f733 [session.timer.start] => 1240469353 [session.timer.last] => 1240469353 [session.timer.now] => 1240469359 ) [CiviCRM] => Array ( ) )
Using Joomla 1.5.9.

If I comment out the redirect to home page, then all functions ok - but not sure how big a risk that this is?

adrianharvey

  • Guest
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 23, 2009, 01:00:37 am

So I can generate the needed variables by visiting the profile edit page:
index.php?option=com_civicrm&amp;task=civicrm/profile/edit&amp;gid=5&amp;reset=1&amp;

Which is the mailing list signup page for me.

Then the unsubscribe pages etc will work.

Using the Session print function, below is the difference  which makes it work:

[CiviCRM] => Array ( [userContext] => Array (
  • => index.php?option=com_civicrm&task=civicrm/profile&reset=1 ) [CRM_Profile_Form_Edit_] => Array ( [qfKey] => [edit] => 1 [gid] => 5 ) ) [_CRM_Core_Controller_Simple__container] => Array ( [defaults] => Array ( ) [constants] => Array ( ) [values] => Array ( [Edit] => Array ( ) ) [valid] => Array ( [Edit] => ) ) )


This is an empty array - [CiviCRM] => Array ( )  -  when using the unsubscribe link directly. Visit the profile page which adds this, then the unsubscribe link works fine.

Thanks.
Adrian

paulsmithx

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 28, 2009, 08:41:05 am
Was there any progress on this issue, or suggestions on how I might fix it myself?

We don't have the luxury of using verp so have to go the url option from the email which means we are unable to go to the profile page first.

Any suggestions would be very well received.
Thanks
Paul

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 28, 2009, 12:16:51 pm
We are currently investigating this issue, will reply here.

Kurund
Found this reply helpful? Support CiviCRM

Shailesh Lende

  • Guest
Re: UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?
April 30, 2009, 02:14:18 am
Hi,

Issue has been filed for this.
For more details  http://issues.civicrm.org/jira/browse/CRM-4431

-Shailesh

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • UnSubscribeURL, OptOutURL & Standalone profile signups broken in 2.2.1?

This forum was archived on 2017-11-26.