• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

RSS feed is broken

Plus 23.05 Development Snapshots (Retired)
5
10
1.2k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    DarkFnh
    last edited by DarkFnh May 7, 2023, 8:41 PM May 7, 2023, 8:40 PM

    I am getting the following error with the RSS feed:

    Fatal error: Uncaught TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given in /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php:3165 Stack trace: #0 /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php(3165): array_slice(Array, 0, '10') #1 /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php(2997): SimplePie\SimplePie::merge_items(Array, 0, '10', 0) #2 /usr/local/www/widgets/widgets/rss.widget.php(109): SimplePie\SimplePie->get_items(0, '10') #3 /usr/local/www/index.php(430): include('/usr/local/www/...') #4 {main} thrown in /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php on line 3165 PHP ERROR: Type: 1, File: /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php, Line: 3165, Message: Uncaught TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given in /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php:3165 Stack trace: #0 /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php(3165): array_slice(Array, 0, '10') #1 /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php(2997): SimplePie\SimplePie::merge_items(Array, 0, '10', 0) #2 /usr/local/www/widgets/widgets/rss.widget.php(109): SimplePie\SimplePie->get_items(0, '10') #3 /usr/local/www/index.php(430): include('/usr/local/www/...') #4 {main} thrown

    Is there a way to remove it as the main page is unusable with the RSS feed causing it to crash.

    This is on the latest 23.05 snapshot

    1 Reply Last reply Reply Quote 0
    • S
      stephenw10 Netgate Administrator
      last edited by May 9, 2023, 12:07 AM

      You can edit the config file at the command line and remove the widget entry for it.

      	<widgets>
      		<sequence>system_information:col1:open:0,disks:col1:open:0,netgate_services_and_support:col2:open:0,interfaces:col2:open:0,rss:col2:open:0</sequence>
      		<period>10</period>
      	</widgets>
      

      So just remove ,rss:col2:open:0

      The RSS widget works OK though. Did you add feeds to it?

      D 1 Reply Last reply May 9, 2023, 12:23 AM Reply Quote 0
      • D
        DarkFnh @stephenw10
        last edited by May 9, 2023, 12:23 AM

        I simply have the default RSS feed and its crashing.

        I haven't modified it at all.

        1 Reply Last reply Reply Quote 0
        • S
          stephenw10 Netgate Administrator
          last edited by May 9, 2023, 11:09 AM

          Hmm, in that case it's probably fixed already. I'm running a newer build that isn't public yet. Should be a in a few days.

          Steve

          1 Reply Last reply Reply Quote 0
          • J
            jimp Rebel Alliance Developer Netgate
            last edited by May 9, 2023, 12:32 PM

            Looks like a completely fresh install has a working RSS widget but if you open the RSS widget settings and click save without changing anything, then you can get that PHP error.

            Inside the <widgets> section of the config.xml, look for a block like this and remove it:

            		<rss-0>
            			<descr><![CDATA[RSS]]></descr>
            			<rssfeed>https://www.netgate.com/blog/</rssfeed>
            			<rssmaxitems>10</rssmaxitems>
            			<rsswidgetheight>300</rsswidgetheight>
            			<rsswidgettextlength>140</rsswidgettextlength>
            		</rss-0>
            

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • J
              jimp Rebel Alliance Developer Netgate
              last edited by May 9, 2023, 12:42 PM

              Probably too late to sneak that into 23.05 at this point but it's not a complex fix, should be easy to get into system patches after the release.

              diff --git a/src/usr/local/www/widgets/widgets/rss.widget.php b/src/usr/local/www/widgets/widgets/rss.widget.php
              index 8da28c1203ffe54168cb919180b84df0b24af35c..c117d468ae8205c5e8d8622feab15b2a39225350 100644
              --- a/src/usr/local/www/widgets/widgets/rss.widget.php
              +++ b/src/usr/local/www/widgets/widgets/rss.widget.php
              @@ -46,15 +46,15 @@ if ($user_settings['widgets'][$widgetkey]['rssfeed']) {
               }
               
               if ($user_settings['widgets'][$widgetkey]['rssmaxitems']) {
              -	$max_items =  $user_settings['widgets'][$widgetkey]['rssmaxitems'];
              +	$max_items =  (int) $user_settings['widgets'][$widgetkey]['rssmaxitems'];
               }
               
               if (is_numeric($user_settings['widgets'][$widgetkey]['rsswidgetheight'])) {
              -	$rsswidgetheight =	$user_settings['widgets'][$widgetkey]['rsswidgetheight'];
              +	$rsswidgetheight = (int) $user_settings['widgets'][$widgetkey]['rsswidgetheight'];
               }
               
               if (is_numeric($user_settings['widgets'][$widgetkey]['rsswidgettextlength'])) {
              -	$rsswidgettextlength =	$user_settings['widgets'][$widgetkey]['rsswidgettextlength'];
              +	$rsswidgettextlength = (int) $user_settings['widgets'][$widgetkey]['rsswidgettextlength'];
               }
               
               // Set a default feed if none exists
              

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 1
              • S
                stephenw10 Netgate Administrator
                last edited by May 9, 2023, 12:43 PM

                Ah, yes that hits the error. Widget shows but can't be removed.

                J 1 Reply Last reply May 9, 2023, 12:45 PM Reply Quote 0
                • J
                  jimp Rebel Alliance Developer Netgate @stephenw10
                  last edited by May 9, 2023, 12:45 PM

                  @stephenw10 said in RSS feed is broken:

                  Ah, yes that hits the error. Widget shows but can't be removed.

                  It likely breaks JS for the whole page, so even navigating to another page from the menu can be a problem, though you can hit the link to the crash reporter page and from there get anywhere else (e.g. Backup/Restore to roll back in the config history).

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 1
                  • J
                    joedan
                    last edited by May 15, 2023, 6:29 AM

                    I just upgraded to 23.05.r.20230513.1527 and hit this bug so rolled back to 23.01.

                    PHP Errors:
                    Uncaught TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given in /usr/local/pfSense/include/vendor/simplepie/simplepie/src/SimplePie.php:3165

                    I assume the fix is not in this particular version yet.

                    G 1 Reply Last reply May 15, 2023, 7:03 AM Reply Quote 0
                    • G
                      Gertjan @joedan
                      last edited by May 15, 2023, 7:03 AM

                      @joedan said in RSS feed is broken:

                      must be of type ?int

                      If "20230513" (buid from last saterday ?) wasn't working, it would/should work with the 3 edited lines shown above by Jimp.

                      No "help me" PM's please. Use the forum, the community will thank you.
                      Edit : and where are the logs ??

                      1 Reply Last reply Reply Quote 1
                      6 out of 10
                      • First post
                        6/10
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.