Jan 8, 2015

Beta 4: drupal_match_path() and drupalSettings.path.basePath() replaced

Moving from Drupal 8 Beta 3 to Beta 4 turned out to be a significant chunk of work.

Much of that was due to functionality that was previously deprecated but still available that has been removed altogether. We continue to be nudged into doing things the D8 way.

Here are a couple of more changes I made for this release. This wraps up my findings for Beta 4.



  Fatal error: Call to undefined function Drupal\optimizely\drupal_match_path() in /var/www/html/opti/modules/contrib/optimizely/src/PathChecker.php on line 193

Function drupal_match_path() has been removed and replaced. For example, instead of the call

  drupal_match_path($target_path, $project_paths)

use this.

  \Drupal::service('path.matcher')->matchPath($target_path, $project_paths)



In javscript code, drupalSettings.path.basePath has been replaced with drupalSettings.path.baseUrl .



Sources:

New PathMatcher service
https://www.drupal.org/node/2274675

current_path() is replaced by the <current> route
https://www.drupal.org/node/2382211

No comments:

Post a Comment