- Changed the XFS v4 notice from a span to a div for better styling and layout.
- Removed the .notice class to prevent duplicate icons, enhancing the visual clarity of the warning message.
- Updated the deprecation message for XFS v4 to specify the migration deadline as 2030, improving user awareness and understanding of the timeline for necessary filesystem upgrades.
- Removed test mode checks for deprecated filesystem warnings in the check_disk_for_deprecated_fs function.
- Streamlined the logic for detecting ReiserFS and XFS v4 filesystems, enhancing code clarity and maintainability.
- Replaced deprecated filesystem warning logic with a shared helper function for better maintainability.
- Updated DeviceInfo.page to utilize the new helper for displaying filesystem warnings.
- Improved the display of critical and notice warnings for deprecated filesystems, including session-based dismissal for notices.
- Added a shared function to check for deprecated filesystems (ReiserFS and XFS v4) across array and cache devices.
- Updated ArrayDevices.page and CacheDevices.page to display warnings for deprecated filesystems.
- Introduced helper functions for generating filesystem warning icons and messages.
- Removed unnecessary 'clone-settings-less-padding' class from the clone-settings div in both SecurityNFS.page and SecuritySMB.page to streamline the layout.
- Added a new form element in ShareEdit.page to enhance share editing functionality.
- Removed unnecessary CSS rules from ShareEdit.css to streamline styling.
- Adjusted padding in default-base.css for better layout consistency.
- Updated CPU load display logic to use dynamic critical and warning thresholds.
- Improved error handling for GraphQL subscription with retry logic and capped backoff.
- Ensured consistent color coding for CPU load indicators.
- Changed Nchan variable to use a consistent naming convention.
- Removed outdated CPU load handling code and replaced it with a GraphQL subscription for real-time CPU metrics.
- Added retry logic for GraphQL subscription initialization.
- Implemented cleanup for the subscription on page unload.
The error occurred because of how searchLink() is called on line 49:
if ($support = searchLink($info, $url) ?: searchLink($info, newurl($url))) {
Here's the sequence of events that caused the issue:
1. First call: searchLink($info, $url) - This works fine if $info contains the JSON data from
/tmp/community.applications/tempFiles/templates.json
2. If first call returns falsy: The ?: operator (shorthand ternary) triggers the second call:
searchLink($info, newurl($url))
3. The problem: When the first searchLink() returns null or false, PHP's ?: operator evaluates
the second expression. However, if $info itself is null (which can happen if the JSON file
doesn't exist or is empty - see line 19 where readJson() returns [] for missing files), then
searchLink(null, newurl($url)) is called.
4. The crash: Inside searchLink(), when $db is null, calling count($db) throws the TypeError
because count() requires an array or Countable object, not null.
Root causes:
- The JSON file at /tmp/community.applications/tempFiles/templates.json might not exist or could
be corrupted
- The readJson() function returns an empty array [] for missing files, but if the JSON decode
fails, it could return null
- The code wasn't defensive against null values being passed to searchLink()
The fix adds is_array($db) check to ensure we only attempt to count when we have a valid array.