Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
twitter_feed
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
twitter_feed
Commits
d98c5f52
Commit
d98c5f52
authored
2 years ago
by
Ravikant Mane
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3127826
by Oleksiy, vaccinemedia: Timeago library not found
parent
2a694d2c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
twitter_feed.module
+24
-4
24 additions, 4 deletions
twitter_feed.module
with
24 additions
and
4 deletions
twitter_feed.module
+
24
−
4
View file @
d98c5f52
...
...
@@ -51,12 +51,22 @@ function twitter_feed_libraries_info() {
function
twitter_feed_library_info_build
()
{
$lib
=
twitter_feed_libraries_info
();
$libraries
=
[];
$library_path
=
NULL
;
if
(
!
function_exists
(
'libraries_get_path'
))
{
// @todo Remove backward compatibility conditions when Drupal requirement will
// be set to 8.9.0. See https://www.drupal.org/node/3099614
if
(
\Drupal
::
hasService
(
'library.libraries_directory_file_finder'
))
{
/** @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder $library_file_finder */
$library_path
=
\Drupal
::
service
(
'library.libraries_directory_file_finder'
)
->
find
(
'timeago'
);
}
elseif
(
\Drupal
::
moduleHandler
()
->
moduleExists
(
'libraries'
))
{
$library_path
=
libraries_get_path
(
'timeago'
);
}
if
(
empty
(
$library_path
))
{
return
NULL
;
}
$library_path
=
libraries_get_path
(
'timeago'
);
if
(
strpos
(
$library_path
,
'/'
)
!==
0
)
{
$library_path
=
'/'
.
$library_path
;
}
...
...
@@ -112,11 +122,21 @@ function twitter_feed_library_info_build() {
* The sorted timeago languages.
*/
function
twitter_feed_timeago_languages
()
{
if
(
!
function_exists
(
'libraries_get_path'
))
{
$path
=
NULL
;
// @todo Remove backward compatibility conditions when Drupal requirement will
// be set to 8.9.0. See https://www.drupal.org/node/3099614
if
(
\Drupal
::
hasService
(
'library.libraries_directory_file_finder'
))
{
/** @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder $library_file_finder */
$path
=
\Drupal
::
service
(
'library.libraries_directory_file_finder'
)
->
find
(
'timeago'
);
}
elseif
(
\Drupal
::
moduleHandler
()
->
moduleExists
(
'libraries'
))
{
$path
=
libraries_get_path
(
'timeago'
);
}
if
(
empty
(
$path
))
{
return
[];
}
$path
=
libraries_get_path
(
'timeago'
);
$files
=
\Drupal
::
service
(
'file_system'
)
->
scanDirectory
(
"
$path
/locales"
,
'/timeago\..{2,14}\.js$/i'
,
[
'recurse'
=>
FALSE
,
'key'
=>
'name'
]);
$timeago_locales
=
[];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment