silverstripe / silverstripe-versionfeed

Provides an RSS feed for global site changes
BSD 3-Clause "New" or "Revised" License
4 stars 13 forks source link

TypeError is triggered when element being compared has a NULL title or Content #95

Closed alex-dna closed 8 months ago

alex-dna commented 9 months ago

Module version(s) affected

3

Description

When a record is saved without a title or content, when viewing the RSS changes feed, a type error occurs.

Uncaught TypeError: SilverStripe\View\Parsers\HtmlDiff::compareHtml(): Argument #1 ($from) must be of type array|string, null given, called in /var/www/html/vendor/silverstripe/versionfeed/src/VersionFeed.php on line 110

How to reproduce

I first encountered the issue with Elemental, after saving an element without a title. But it should be the case for any page too (although it is less likely to save a page without title through the CMS). Easiest way to reproduce is to temper with database if possible, set a page record version title or content to NULL, then visit the page URL/changes.

Possible Solution

No response

Additional Context

No response

Validations

PRs

GuySartorelli commented 8 months ago

PR merged. This will be automatically tagged by GitHub actions.