From 3346af742f009a75ccff76cde2bc733fb2f2deb2 Mon Sep 17 00:00:00 2001
From: MegaChriz <MegaChriz@654114.no-reply.drupal.org>
Date: Wed, 5 Aug 2015 20:43:58 -0700
Subject: [PATCH] Issue #2530670 by MegaChriz: Filter log in Views by "Message"

---
 views/feeds.views.inc | 79 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 60 insertions(+), 19 deletions(-)

diff --git a/views/feeds.views.inc b/views/feeds.views.inc
index f754beb2..ff88606a 100644
--- a/views/feeds.views.inc
+++ b/views/feeds.views.inc
@@ -189,13 +189,13 @@ function feeds_views_data() {
     'group' => 'Feeds log',
     'base' => array(
       'field' => array('flid'),
-      'title' => 'Feeds log',
-      'help' => 'Logs events during importing, clearing, expiry.',
+      'title' => t('Feeds log'),
+      'help' => t('Logs events during importing, clearing, expiry.'),
     ),
   );
   $data['feeds_log']['id'] = array(
-    'title' => 'Importer id',
-    'help' => 'The id of an importer.',
+    'title' => t('Importer id'),
+    'help' => t('The id of an importer.'),
     'field' => array(
       'handler' => 'views_handler_field',
       'click sortable' => TRUE,
@@ -203,15 +203,15 @@ function feeds_views_data() {
     'filter' => array(
       'handler' => 'views_handler_filter_string',
       'allow empty' => TRUE,
-      'help' => 'Filter on an importer id.',
+      'help' => t('Filter on an importer id.'),
     ),
     'argument' => array(
       'handler' => 'feeds_views_handler_argument_importer_id',
-      'help' => 'Filter on an importer id.',
+      'help' => t('Filter on an importer id.'),
     ),
     'sort' => array(
       'handler' => 'views_handler_sort',
-      'help' => 'Sort by importer id.',
+      'help' => t('Sort by importer id.'),
     ),
     'relationship' => array(
       'title' => t('Importer'),
@@ -223,15 +223,15 @@ function feeds_views_data() {
   );
   $data['feeds_log']['importer_name'] = array(
     'real field' => 'id',
-    'title' => 'Importer name',
-    'help' => 'The human readable name of an importer.',
+    'title' => t('Importer name'),
+    'help' => t('The human readable name of an importer.'),
     'field' => array(
       'handler' => 'feeds_views_handler_field_importer_name',
     ),
   );
   $data['feeds_log']['feed_nid'] = array(
-    'title' => 'Feed node id',
-    'help' => 'Contains the node id of a feed node if the feed\'s configuration is attached to a content type, otherwise contains 0.',
+    'title' => t('Feed node id'),
+    'help' => t('Contains the node id of a feed node if the feed\'s configuration is attached to a content type, otherwise contains 0.'),
     'field' => array(
       'handler' => 'views_handler_field_numeric',
       'click sortable' => TRUE,
@@ -239,17 +239,17 @@ function feeds_views_data() {
     'filter' => array(
       'handler' => 'views_handler_filter_numeric',
       'allow empty' => TRUE,
-      'help' => 'Filter on a Feeds Source\'s feed_nid field.',
+      'help' => t('Filter on a Feeds Source\'s feed_nid field.'),
     ),
     'argument' => array(
       'handler' => 'views_handler_argument_numeric',
       'numeric' => TRUE,
       'validate type' => 'nid',
-      'help' => 'Argument on a Feeds Source\'s feed_nid field.',
+      'help' => t('Argument on a Feeds Source\'s feed_nid field.'),
     ),
     'sort' => array(
       'handler' => 'views_handler_sort',
-      'help' => 'Sort Feeds Source\'s feed_nid field.',
+      'help' => t('Sort Feeds Source\'s feed_nid field.'),
     ),
     'relationship' => array(
       'title' => t('Feed node'),
@@ -272,6 +272,12 @@ function feeds_views_data() {
     'filter' => array(
       'handler' => 'views_handler_filter_date',
     ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
   );
   $data['feeds_log']['request_time'] = array(
     'title' => t('Request time'),
@@ -286,10 +292,33 @@ function feeds_views_data() {
     'filter' => array(
       'handler' => 'views_handler_filter_date',
     ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+  $data['feeds_log']['type'] = array(
+    'title' => t('Type'),
+    'help' => t('Type of log message.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
   );
   $data['feeds_log']['message'] = array(
-    'title' => 'Log message',
-    'help' => 'The message logged by the event.',
+    'title' => t('Log message'),
+    'help' => t('The message logged by the event.'),
     'field' => array(
       'handler' => 'feeds_views_handler_field_log_message',
       'click sortable' => FALSE,
@@ -297,10 +326,16 @@ function feeds_views_data() {
         'variables',
       ),
     ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
   );
   $data['feeds_log']['severity'] = array(
-    'title' => 'Severity',
-    'help' => 'The severity of the event logged.',
+    'title' => t('Severity'),
+    'help' => t('The severity of the event logged.'),
     'field' => array(
       'handler' => 'feeds_views_handler_field_severity',
       'click sortable' => FALSE,
@@ -308,7 +343,13 @@ function feeds_views_data() {
     'filter' => array(
       'handler' => 'feeds_views_handler_filter_severity',
       'allow empty' => TRUE,
-      'help' => 'Filter on the severity of a log message.',
+      'help' => t('Filter on the severity of a log message.'),
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
     ),
   );
   $data['feeds_log']['table']['join'] = array(
-- 
GitLab