Problem/Motivation

An error has started popping up more and more on our project where old revisions containing \r\n line endings are resulting in errors when compared with new revisions that only contain \n

The error is Uncaught PHP Exception InvalidArgumentException: "Invalid $mode 3 specified" and results in a 503.

Steps to reproduce

I've only seen this happen with really old revisions, now \r seems to get auto stripped from WYSIWYG content.

Proposed resolution

?

Remaining tasks

Issue fork diff-3389010

Command icon 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:

Comments

acbramley created an issue. See original summary.

mstrelan’s picture

This is introduced since DiffEngine is deprecated and replaced with sebastianbergmann/diff. Specifically the issue is that \Drupal\Component\Diff\DiffOpOutputBuilder::hunkOp does not handle \SebastianBergmann\Diff\Differ::DIFF_LINE_END_WARNING.

mstrelan’s picture

Opened #3389715: Diffs with different line endings leads to Invalid $mode 3 specified. Postponing on that issue in case there's further work to be done here.

micahw156’s picture

Confirming the patch for #3389715 resolved my use case for diff module errors.

stolzenhain’s picture

Thanks for this issue and the linking of #3389715 – patch works fine.