From ec5d6f7e83b5738ceff52787544f294f75552fbe Mon Sep 17 00:00:00 2001
From: dastagg <dastagg@626068.no-reply.drupal.org>
Date: Tue, 4 Feb 2014 00:30:20 -0500
Subject: [PATCH] Issue #1333266 by dastagg | webchick: Link to feed importers
 broken when no feed importers exist.

---
 feeds.pages.inc | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/feeds.pages.inc b/feeds.pages.inc
index 7e1a164a..9bed7b71 100644
--- a/feeds.pages.inc
+++ b/feeds.pages.inc
@@ -36,7 +36,22 @@ function feeds_page() {
     }
   }
   if (empty($rows)) {
-    drupal_set_message(t('There are no importers, go to <a href="@importers">Feed importers</a> to create one or enable an existing one.', array('@importers' => url('admin/structure/feeds'))));
+    // The feeds_ui module is enabled.
+    if (module_exists('feeds_ui') && user_access('administer feeds')) {
+      drupal_set_message(t('There are no importers, go to <a href="@importers">Feed importers</a> to create one or enable an existing one.', array('@importers' => url('admin/structure/feeds'))));
+    }
+    else {
+      // The feeds_ui module is not enabled but the current user has access to
+      // Modules to enable it.
+      if (user_access('administer modules')) {
+        drupal_set_message(t('The Feeds UI Admin module is not enabled and there are no importers, go to <a href="@modules">Modules</a> and enable Feeds Admin UI. Then go to <a href="@importers">Feed importers</a> to create one or enable an existing one.', array('@modules' => url('admin/modules'), '@importers' => url('admin/structure/feeds'))));
+      }
+      else {
+        // The feeds_ui module is not enabled and the current user cannot
+        // enable it.
+        drupal_set_message(t("The Feeds UI Admin module is not enabled. Please contact the Administrator for your site and ask them to enable it."));
+      }
+    }
   }
   $header = array(
     t('Import'),
-- 
GitLab