Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
alex-dna opened this issue Jan 23, 2024 · 1 comment
Closed
2 tasks done

Comments

@alex-dna
Copy link
Contributor

alex-dna commented Jan 23, 2024

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

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

PRs

@GuySartorelli
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants