From 94a29ed08e7a1a78a838c70d9e30164811118713 Mon Sep 17 00:00:00 2001
From: joelpittet <joelpittet@160302.no-reply.drupal.org>
Date: Tue, 23 Jun 2015 12:50:53 -0700
Subject: [PATCH] Issue #2509464 by twistor, joelpittet: Feeds module cannot
 find its parser module due to filesystem restriction

---
 feeds.module | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/feeds.module b/feeds.module
index 9711881b..79be1de8 100644
--- a/feeds.module
+++ b/feeds.module
@@ -1111,10 +1111,11 @@ function feeds_include_library($file, $library) {
 
     $library_dir = variable_get('feeds_library_dir', FALSE);
     $feeds_library_path = DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/$file";
+    $libraries_path = module_exists('libraries') ? libraries_get_path($library) : FALSE;
 
     // Try first whether libraries module is present and load the file from
     // there. If this fails, require the library from the local path.
-    if (module_exists('libraries') && $path = libraries_get_path($library) && is_file("$path/$file")) {
+    if ($libraries_path && is_file("$libraries_path/$file")) {
       require "$path/$file";
       $included[$key] = TRUE;
     }
@@ -1148,18 +1149,16 @@ function feeds_include_library($file, $library) {
  *   libraries module.
  */
 function feeds_library_exists($file, $library) {
-  if (module_exists('libraries') && $path = libraries_get_path($library) && is_file("$path/$file")) {
+  $path = module_exists('libraries') ? libraries_get_path($library) : FALSE;
+  if ($path && is_file($path . '/' . $file)) {
     return TRUE;
   }
-
   elseif (is_file(DRUPAL_ROOT . "/sites/all/libraries/$library/$file")) {
     return TRUE;
   }
-
   elseif (is_file(DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/$file")) {
     return TRUE;
   }
-
   elseif ($library_dir = variable_get('feeds_library_dir', FALSE)) {
     if (is_file("$library_dir/$library/$file")) {
       return TRUE;
-- 
GitLab