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

Handling for routes with parameters in the url with slashes

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7
    • Fix Version/s: 4.7.16
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      This is a continuation of the issue resolved here:
      https://issues.civicrm.org/jira/browse/CRM-1983

      Drupal does not allow the passing of parameters to routes that contain slashses, since 8.0-beta13

      This was discovered making the CiviCRM menu work with Drupal 8.2.5

      so to get the menu you have something like this in the path:
      civicrm/ajax/menujs/202/en_US/1/NFmjWSlO
      with this bit: 202/en_US/1/NFmjWSlO
      being parameters passed to the route as url path components
      or as Drupal sees it it is either its own distinct path, which will result in a 404,
      OR
      its one parameter, "containing slashes"

      To make it work, we had to create a PathProcessor service, and if the path is the menu path, take the parameters, replace '/' with ':' and pass those as the $extra parameter to the controller

      We need to all other paths that need this handling, or figure a way to automate the path processor that is not on a path by path basis

        Attachments

          Activity

            People

            • Assignee:
              jackrabbithanna Mark Hanna
              Reporter:
              jackrabbithanna Mark Hanna
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: