Closed (fixed)
Project:
Autosave Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Oct 2019 at 07:02 UTC
Updated:
29 Dec 2019 at 08:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sergiu stici commentedHere is the patch, please review.
Comment #3
anavarreLooks good, thank you.
Comment #4
effulgentsia commentedThis assumes that the form display already exists. I think the reason #2 passed tests is that the only entity type being tested is Node, and the test setup's drupalCreateContentType() calls node_add_body_field(), which has the side effect of creating and saving a form display. I'm not sure that would be the case if this test is subclassed by something that tests a different entity type.
https://www.drupal.org/node/2835616 says to use
\Drupal::service('entity_display.repository')->getFormDisplay()instead, which creates a new display entity if it doesn't already exist. However, that's an API that's only available in Drupal 8.8, and this module might still want to be working with Drupal 8.7.Comment #5
hchonov@effulgentsia, thank you! This is something I wanted to check, but unfortunately I just forgot. I apologize for the delay.
And yes, I would prefer supporting as many Drupal versions as possible. It might not be a clean code, but maybe we could check whether the 8.7 method exists and if not fallback to the old one?
Comment #6
effulgentsia commentedLike this?
Comment #8
hchonovExactly, thank you!
Committed and pushed to 8.x-1.x.
Comment #9
milindk commentedVerified on latest 8.8.0 release.