Problem/Motivation
Using Diff version ^2
Fatal error: Declaration of Drupal\state_machine\Plugin\diff\Field\StateFieldBuilder::build(Drupal\Core\Field\FieldItemListInterface $field_items) must be compatible with Drupal\diff\Plugin\diff\Field\CoreFieldBuilder::build(Drupal\Core\Field\FieldItemListInterface $field_items): array in /src/Plugin/diff/Field/StateFieldBuilder.php on line 24- RendererInterface::renderPlain() is deprecated in favour of ::renderInIsolation()
Steps to reproduce
I went into content revisions and try to Compare selected revisions and that errors appears.
Proposed resolution
- Add 'array' as the function return type in build
- Change renderPlain() into renderInIsolation()
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork diff-3542871
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:
- 3542871-fatal-error-and
compare
1 hidden branch
Issue fork state_machine-3542871
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
Comment #2
saidatomComment #3
saidatomComment #4
saidatomComment #7
saidatomComment #8
huzookaComment #9
saidatomComment #10
jsacksick commentedThe change isn't valid as is.
The deprecation helper was introduced in D10.1.3, and we currently still support D9. So either we drop support as part of this change, or we do this differently.
Also the return type issue can be fixed separately from the renderInIsolation() calls.
Comment #12
tbkot commentedMR is updated to include "conflict" in the composer for the diff module 2+ version. I suggest creating a separate issue and a new branch to disable D9 support, where we can use diff 2+ and update the StateFieldBuilder class to be compatible.
Comment #13
jsacksick commentedI see no problem updating the return type and still support diff v2 from the same branch.
There is no issue with that, specifying the return type isn't going to break the v1 support.
Comment #14
tbkot commented@jsacksick return type is updated, and composer.json reverted to default.
Comment #16
jsacksick commented