From 76753b3dfb46ee83ddeb51572b8b4a35137f5ace Mon Sep 17 00:00:00 2001 From: VasanthaKaje Date: Tue, 28 Feb 2017 22:19:13 +0530 Subject: [PATCH] Crm19905 (#9749) * CRM-19905 Drupal 8 User View and Edit pages broken when CiviCRM profiles set for User Registration * CRM-19905 Drupal 8 User View and Edit pages broken when CiviCRM profiles set for User Registration [moved the changes to Drupal8.php file to make it specific for D8] * Overrode postURL function for D8 to fix CRM-19905 * CRM19905 correction for PR#9749, to remove Superflous whitespace error * Update Drupal8.php Remove extra whitespaces --- CRM/Utils/System/Drupal8.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index 475490bb3c..8d931aa045 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -617,4 +617,20 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { ); } + /** + * Drupal 8 has a different function to get current path, hence + * overriding the postURL function + * + * @param string $action + * + * @return string + */ + public function postURL($action) { + if (!empty($action)) { + return $action; + } + $current_path = \Drupal::service('path.current')->getPath(); + return $this->url($current_path); + } + } -- 2.25.1