I need to get this hook to pre create a fix number of paragraphs.
Also I saw that the hook entity prepare form is never triggering with IEF.
Here a patch to call this hook
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff_3-8.txt | 1.74 KB | eugene.brit |
| #8 | 3015323-8.patch | 1.53 KB | eugene.brit |
| #3 | 3015323-3.patch | 1.89 KB | ziomizar |
| #3 | interdiff.txt | 935 bytes | ziomizar |
| #2 | hook_entity_prepare_form-3015323-1.patch | 1.78 KB | musa.thomas |
Comments
Comment #2
musa.thomasComment #3
ziomizar commentedThe patch on #2 for me, just a minor fix on the $entity parameter
Comment #4
neeravbm commentedThe patch is working fine. I was able to apply the patch using Composer. Then I added hook_entity_prepare_form() in a custom module and made sure that the code in this hook is being executed.
Comment #5
joachim commentedWhat's the reason for building the function name rather than using module handler's invokeAll()? This should be explained in the comments.
I don't understand how the comment relates to the code. Where or what is the updated translation object?
Comment #6
ziomizar commentedJust a minor hint is that the suggestions and questions reported in #5 apply also in core from which this patch has been based https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityForm...
Comment #7
geek-merlinThank ya all! Setting major as this violates a basic API expectation.
As of #5/#6: An updated patch should state where that code is copied from (no shame ;-). And rewrite comments that probably had been copied but not adapted before (shame!).
Comment #8
eugene.britRe-roll #3 for 10.0.x
Comment #9
podarokComment #11
podarok#8 is in
tnx
Comment #13
geek-merlinBulk reopen.
Comment #14
geek-merlinI still like this a lot. Revisiting this after quite some time, my gut feeling is that this must not re-purpose hook_entity_prepare_form, but invent an IEF version of it. (Anyone with a good reasoning that it is not so, please explain!)
Comment #15
geek-merlinThe related issue confirms that this implementation is wrong and must not be committed.
An IEF version of that hook makes sense though.
Comment #16
dwwThis seems to have caused some major regressions. See #3364996: Parent form entity builders run on IEF resulting in fatal errors
Comment #17
geek-merlin#14:
> still like this a lot. Revisiting this after quite some time, my gut feeling is that this must not re-purpose hook_entity_prepare_form, but invent an IEF version of it.
Comment #3364996-15: Parent form entity builders run on IEF resulting in fatal errors of that issue elaboratest that brilliantly.
Updating title accordingly.
Comment #18
geek-merlin