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

Links to Drupal system broken if hook altered by a module

    Details

    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      In several places Civi is assuming Drupal system urls are at admin/... or user/...

      If a Drupal module like Rename Admin Paths alters these in a hook, then the links break.

      I have found these at:

      1) civicrm/contact/view

      • User ID link in Summary
      • User Record link in Actions flyout menu

      2) civicrm/admin/access

      • The two Drupal Access Control links

      3) Feature: Check if username and email exists in the drupal db.
      Function: checkUserNameEmailExists()
      File: Drupal.php

      I have squashed 1 and 2 by simply using url() instead.

      So for example function getUserRecordUrl() in DrupalBase.php:

        return CRM_Utils_System::url('user/' . $uid);
      

      We change to use:

        return url('user/' . $uid);
      

      This fixes both the User Record link on the Actions menu flyout of the Contact View page and the User ID link next to Contact ID at:
      civicrm/contact/view?reset=1&cid=1

      Also on Permissions (Access Control) the Drupal Access Control link is broken and can be fixed similar to above in CRM/Admin/Page/Access.php

      I don't know civi all that well, but it doesn't seem right to not let Drupal hook these CMS system url's, so can I suggest changing them so Drupal url() function handles CMS urls instead.

      Happy to pull D7 and 4.6.x

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              rollox Will Mowlam
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m