Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20053

Wordpress MailingEventSubscribe URL uses wp-admin/admin.php

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.14, 4.7.16
    • Fix Version/s: None
    • Component/s: CiviMail
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      I'm setting up a mailing list in CiviCRM (originally 4.7.14, now 4.7.16) and the latest Wordpress. I created a plugin to call MailingEventSubscribe to add an email to a group, pending clicking the link in a confirmation email.

      In Administer->System Settings->CMS Database Integration, I have the base page set to /civicrm. Yet when the mailing list subscribe confirmation is sent, the subscribe.url token uses http://mydomain.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/mailing/confirm&reset=1&etc...

      I tracked this down to /CRM/Utils/System/Wordpress.php line 280. The condition is met of is_admin() and !$frontend, so the $base is set to wp-admin/admin.php instead of using the /civicrm/ base.

      I can fix this by changing line 246 of CRM/Mailing/Event/BAO/Subscribe.php to set $frontend to 1:

      $url = CRM_Utils_System::url('civicrm/mailing/confirm',
      "reset=1&cid={$this->contact_id}&sid={$this->id}&h={$this->hash}",
      TRUE, '', '', 1
      );

      But I don't know whether this will cause other problems.

      I suspect this will also need to be done where the unsubscribe.url is generated, and maybe elsewhere.

      I'm not sure of the cleanest way to address this problem for all cases.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              norris Norris Thomlinson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: