[Rt-commit] rtir branch 5.0.4-releng updated. 5.0.4beta1-4-g48988981

BPS Git Server git at git.bestpractical.com
Thu May 4 14:57:45 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtir".

The branch, 5.0.4-releng has been updated
       via  4898898176c18be3808e13b810736e2cab161660 (commit)
       via  84e9a5a7cdddabff8a06f50793a2264589f08c29 (commit)
      from  c03ad90fa692d92db7921e64f22eb270340bb5f0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4898898176c18be3808e13b810736e2cab161660
Merge: c03ad90f 84e9a5a7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 4 22:56:28 2023 +0800

    Merge branch '5.0/external-feed-better-log' into 5.0.4-releng


commit 84e9a5a7cdddabff8a06f50793a2264589f08c29
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Thu May 4 10:31:00 2023 -0300

    Improve External Feeds message when no content found
    
    External Feeds page was throwing a parse error when no content was found.
    This commit improves the message to be more user friendly.

diff --git a/lib/RT/IR/ExternalFeeds.pm b/lib/RT/IR/ExternalFeeds.pm
index 9ee7847e..0e25264d 100644
--- a/lib/RT/IR/ExternalFeeds.pm
+++ b/lib/RT/IR/ExternalFeeds.pm
@@ -109,9 +109,12 @@ sub _parse_rss_feed {
     my ($self, $response) = @_;
     return { __error => "Can't reach feed : " . $response->status_line } unless ($response->is_success);
     eval { $self->{_rss_parser}->parse($response->content); };
-    unless ( $self->{_rss_parser}{channel}{title} && $self->{_rss_parser}{items}[0] ) {
+    if ( !$self->{_rss_parser}{channel}{title} ) {
         return { __error => "Couldn't parse RSS response "};
     }
+    elsif ( !$self->{_rss_parser}{items}[0] ) {
+        return { __error => "There is no recent content for this feed" };
+    }
 
     my $parsed_feed = { map { ucfirst($_) => $self->{_rss_parser}{channel}{$_} }
                             ( qw(title description pubDate lastBuildDate) ) };

-----------------------------------------------------------------------

Summary of changes:
 lib/RT/IR/ExternalFeeds.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
rtir


More information about the rt-commit mailing list