If the file was deleted that was once attached to a revision, then a 500 when comparing the two revisions.
Error: Call to a member function getFilename() on null in Drupal\diff\Plugin\diff\Field\FileFieldBuilder->build() (line 40 of modules/contrib/diff/src/Plugin/diff/Field/FileFieldBuilder.php).
Drupal protects against this use case because file deletion doesn't happen ootb with files are removed from revisions on nodes.
However, this can happen if there is custom code to handle it.
Issue fork diff-3249765
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3249765-2.x
changes, plain diff MR !134
- 3249765-500-deleted-file
changes, plain diff MR !9
Comments
Comment #3
odenscThanks @timodwhit! Confirmed this patch fixes the issue on Drupal 10.1.5, PHP 8.1.18, and diff 8.x-1.1.
Comment #4
acbramley commentedThanks for the work on this one. I've recently taken up maintainership of this project and am looking through the RTBC issues.
This fix looks good.
To get this in, I'll need the MR rebase against the latest 8.x-1.x code with tests added.
Thanks!
Comment #8
acbramley commentedComment #9
acbramley commentedComment #11
acbramley commented