<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PHP Error when loading Backup &amp; Restore page]]></title><description><![CDATA[<p dir="auto">Discovered a bug in 23.01.b.20230106.0600</p>
<p dir="auto">Seems there is an issue enumerating the packages installed when loading the Backup &amp; Restore page when there are no packages installed on the system.</p>
<p dir="auto">Steps to reproduce</p>
<ol>
<li>Have no packages installed.</li>
<li>Install a package (e.g. System_patches)</li>
<li>Remove the package - you now have no packages installed on the system again.</li>
<li>Click on Diagnostics &gt; Backup &amp; Restore. You should be met with the below error message.</li>
</ol>
<pre><code>PHP ERROR: Type: 1, File: /usr/local/www/diag_backup.php, Line: 280, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/diag_backup.php:280
Stack trace:
#0 {main}
thrown @ 2023-01-14 12:36:28
</code></pre>
<p dir="auto">Found a temp fix can be done by editing the /cf/conf/config.xml and removing the following empty tags.</p>
<pre><code>&lt;installedpackages&gt;
&lt;/installedpackages&gt;
</code></pre>
<p dir="auto">As such seems to be some kind of enumeration error when there are no packages installed on the system, by removing the tags you negate the checks to load the Reinstall packages section of the Backup &amp; Restore page so it loads fine.</p>
<p dir="auto"><a href="/assets/uploads/files/1673677202576-php_errors.log.txt">PHP_errors.log.txt</a></p>
]]></description><link>https://forum.netgate.com/topic/177120/php-error-when-loading-backup-restore-page</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 16:29:11 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/177120.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Jan 2023 06:22:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PHP Error when loading Backup &amp; Restore page on Mon, 16 Jan 2023 15:05:58 GMT]]></title><description><![CDATA[<p dir="auto">Oddly enough I can't reproduce the PHP error but I can see where it would happen (and should happen). I've got a change that should fix it, though:</p>
<p dir="auto"><a href="https://redmine.pfsense.org/issues/13876" target="_blank" rel="noopener noreferrer nofollow ugc">https://redmine.pfsense.org/issues/13876</a></p>
<pre><code class="language-diff">index 18bb573b0c..21d1847e09 100644
--- a/src/usr/local/www/diag_backup.php
+++ b/src/usr/local/www/diag_backup.php
@@ -268,10 +268,12 @@ $section-&gt;add($group);
 
 $form-&gt;add($section);
 
-if (($config['installedpackages']['package'] != "") || (is_subsystem_dirty("packagelock"))) {
+$has_installed_packages = !empty(config_get_path('installedpackages/package', []));
+
+if ($has_installed_packages || (is_subsystem_dirty("packagelock"))) {
        $section = new Form_Section('Package Functions');
 
-       if ($config['installedpackages']['package'] != "") {
+       if ($has_installed_packages) {
                $group = new Form_Group('');
                // Note: ID attribute of each element created is to be unique.  Not being used, suppressing it.
                $group-&gt;add(new Form_Button(
</code></pre>
]]></description><link>https://forum.netgate.com/post/1080672</link><guid isPermaLink="true">https://forum.netgate.com/post/1080672</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Mon, 16 Jan 2023 15:05:58 GMT</pubDate></item><item><title><![CDATA[Reply to PHP Error when loading Backup &amp; Restore page on Mon, 16 Jan 2023 00:56:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chickendog">@<bdi>chickendog</bdi></a> Ahh, yeah, Jim's one of our engineers. I am doing other testing internally so I don't get to see the public build numbers.  We are in our own bubble here in TAC :D</p>
]]></description><link>https://forum.netgate.com/post/1080601</link><guid isPermaLink="true">https://forum.netgate.com/post/1080601</guid><dc:creator><![CDATA[rcoleman-netgate]]></dc:creator><pubDate>Mon, 16 Jan 2023 00:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to PHP Error when loading Backup &amp; Restore page on Sun, 15 Jan 2023 23:24:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rcoleman-netgate">@<bdi>rcoleman-netgate</bdi></a> Dev said so here <a href="https://forum.netgate.com/post/1080237">https://forum.netgate.com/post/1080237</a></p>
]]></description><link>https://forum.netgate.com/post/1080595</link><guid isPermaLink="true">https://forum.netgate.com/post/1080595</guid><dc:creator><![CDATA[chickendog]]></dc:creator><pubDate>Sun, 15 Jan 2023 23:24:52 GMT</pubDate></item><item><title><![CDATA[Reply to PHP Error when loading Backup &amp; Restore page on Sun, 15 Jan 2023 21:29:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chickendog">@<bdi>chickendog</bdi></a> It's definitely possible - I don't follow the engineering progress closely enough to know for certain one way or the other.</p>
]]></description><link>https://forum.netgate.com/post/1080582</link><guid isPermaLink="true">https://forum.netgate.com/post/1080582</guid><dc:creator><![CDATA[rcoleman-netgate]]></dc:creator><pubDate>Sun, 15 Jan 2023 21:29:48 GMT</pubDate></item><item><title><![CDATA[Reply to PHP Error when loading Backup &amp; Restore page on Sun, 15 Jan 2023 21:27:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rcoleman-netgate">@<bdi>rcoleman-netgate</bdi></a> Yes but that is the latest build available on the 23.01 branch as of today. I think they freezed it?</p>
]]></description><link>https://forum.netgate.com/post/1080580</link><guid isPermaLink="true">https://forum.netgate.com/post/1080580</guid><dc:creator><![CDATA[chickendog]]></dc:creator><pubDate>Sun, 15 Jan 2023 21:27:48 GMT</pubDate></item><item><title><![CDATA[Reply to PHP Error when loading Backup &amp; Restore page on Sun, 15 Jan 2023 21:21:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chickendog">@<bdi>chickendog</bdi></a> Can you upgrade to the current release? Your build appears to be more than a week old (a buildstamp of Jan 6, 2023 at 6am).</p>
]]></description><link>https://forum.netgate.com/post/1080576</link><guid isPermaLink="true">https://forum.netgate.com/post/1080576</guid><dc:creator><![CDATA[rcoleman-netgate]]></dc:creator><pubDate>Sun, 15 Jan 2023 21:21:11 GMT</pubDate></item></channel></rss>