nuvoleweb / ui_patterns

[NOTE] Development has moved to https://drupal.org/project/ui_patterns
https://drupal.org/project/ui_patterns
GNU General Public License v2.0
85 stars 56 forks source link

Issue #267: Don't store absolute base path to avoid cache issues. #268

Open mikemccaffrey opened 5 years ago

mikemccaffrey commented 5 years ago

This should resolve the issue discussed in #267. By moving the str_replace of the drupal root to earlier in the process, it keeps it from being cached in the cache_discovery table, which avoids problem when code is deployed on a cloud environment and the storage binding changes in the path on the server.

geek-merlin commented 2 years ago

A cleaner way to do this: Change this line in \Drupal\ui_patterns_library\Plugin\Deriver\LibraryDeriver::getExtensionLocations that adds this prefix in the first place (and maybe clean up the 'root' property):

$this->extensionLocations[$this->root . DIRECTORY_SEPARATOR . $extension->getPath()] = $name;