Skip to content
Snippets Groups Projects
Commit 2608d388 authored by anton1211's avatar anton1211
Browse files

Fix. Defining the path to the js file

parent 3f6ad223
No related branches found
No related tags found
1 merge request!31Fix. Defining the path to the js file
Pipeline #259211 failed
......@@ -36,6 +36,8 @@ class StorageHandler implements \Cleantalk\Common\StorageHandler\StorageHandler
if ( ! empty( static::$jsLocation ) ) {
return static::$jsLocation;
}
return \Drupal::request()->getSchemeAndHttpHost() . "/modules/cleantalk/js/apbct-functions.js";
return \Drupal::request()->getSchemeAndHttpHost() .
\Drupal::service('extension.list.module')->getPath('cleantalk') .
"/js/apbct-functions.js";
}
}
......@@ -111,7 +111,9 @@ class BootSubscriber implements HttpKernelInterface
if (\Drupal::config('cleantalk.settings')->get('cleantalk_sfw')) {
$cleantalk_key = trim(\Drupal::config('cleantalk.settings')->get('cleantalk_authkey'));
StorageHandler::$jsLocation = $request->getSchemeAndHttpHost() . "/modules/cleantalk/js/apbct-functions.js";
StorageHandler::$jsLocation = $request->getSchemeAndHttpHost() .
\Drupal::service('extension.list.module')->getPath('cleantalk') .
"/js/apbct-functions.js";
if ($cleantalk_key) {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment