Hi there! I've been playing with this module for Drupal 8 and seeing it's possible (very glad it's already fairly usable!)
Does anyone know whether configuration entities supported with the Inline Entity form? They are selectable with a normal entity reference, but when assigned to a configuration entity (I tried with language) I got an error essentially saying that the entity doesn't define a Default form.
Is this supposed to work or is it unsupported?
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | rebasepatch.patch | 16.39 KB | marelpup |
| #35 | rebasepatch.patch | 0 bytes | marelpup |
| #17 | 2581223-17.patch | 15.69 KB | kapilv |
| #4 | interdiff.txt | 1.99 KB | dylan donkersgoed |
| #4 | support_for-2581223-4.patch | 8.76 KB | dylan donkersgoed |
Issue fork inline_entity_form-2581223
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
bojanz commentedCurrently unsupported.
Comment #3
dylan donkersgoed commentedI've attached a basic patch that provides this functionality. So far so good, though it probably warrants a bit more testing and possible tweaks as well as some automated tests.
Comment #4
dylan donkersgoed commentedI ran into some issues with the inline entity form for config entities not submitting due to #after_build callbacks. I've attached a patch that fixes that, and also addresses #pre_render callbacks. I'm sure there's more to be done here but I'm not sure what should be done with which callbacks beyond that yet.
Comment #5
attisanwhen translation is enabled on host entities, TranslationHelper needs to only alter ContentEntityInterface entities. I patched TranslationHelper to work with EntityInterface instead of ContentEntityInterface and only alter ContentEntityInterface entities.
hth
Comment #7
attisanComment #9
jienckebd commentedI got the below error when using a complex IEF widget with a config entity. The attached patch has a few line change in ConfigEntityInlineForm to handle this scenario.
Comment #10
dieterholvoet commentedI fixed an issue when cancelling creating a new entity or when removing an added entity, both in the complex widget.
Comment #11
socialnicheguru commented#10 is not applying for me
Comment #12
suresh prabhu parkala commentedRe-rolled patch.
Comment #13
geek-merlinThis does not apply anymore and needs a re-roll.
An issue fork is appreciated a lot!
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Comment #16
spokjeRerolled patch #12 in fork
Comment #17
kapilv commentedComment #19
spokjeComment #20
attisanthe last patch does not apply to the current module. would love to contribute but am at a hurry atm.
inline_entity_form_entity_type_build should look like this. instead, the patch is replacing the content of the first if (node).
Comment #22
jasonawantThe EntityInlineForm::getFormDisplay() parameter signature needs to updated to allow config entities like the EntityInlineForm::buildEntity method was updated in the last MR > https://git.drupalcode.org/project/inline_entity_form/-/merge_requests/2...
Comment #24
podarokpushed to 2.0.x
thanks
Comment #26
anpolimusThank you all on pushing this feature forward.
I'm testing it and can see that more or less code works, but fails on the save.
For example, I have menu as reference and want to create new and save it.
On save action I'm getting:
TypeError: Drupal\inline_entity_form\ReferenceUpgrader::upgradeEntityReferences(): Argument #1 ($entity) must be of type Drupal\Core\Entity\FieldableEntityInterface, Drupal\system\Entity\Menu given, called in /var/www/docroot/modules/contrib/inline_entity_form/src/WidgetSubmit.php on line 57 in Drupal\inline_entity_form\ReferenceUpgrader->upgradeEntityReferences() (line 46 of /var/www/docroot/modules/contrib/inline_entity_form/src/ReferenceUpgrader.php)That is because, code of the reference save was hard-coded to work with content entities.
We have to add config entity support here:
https://git.drupalcode.org/project/inline_entity_form/-/blob/8.x-1.x/src...
Comment #27
martijn de wit@anpolimus can you create a new issue ticket as follow up ?
Comment #28
podarokIssue will be created, no worries. I'm also involved in this fix
Comment #29
anpolimusLink to new issue: https://www.drupal.org/project/inline_entity_form/issues/3365747
Comment #30
geek-merlinBulk reopen.
Comment #31
geek-merlinThis urgently needs tests before any commit. As the issue tag sais.
Comment #33
marelpup commentedHi ,
I referenced another issue asking for complex support
https://www.drupal.org/project/inline_entity_form/issues/3228086#comment...
I pushed a rebased version of 3.0 on this branch issue , I do not know if drupal git policies are okay with that
Andrii said it was needed
https://git.drupalcode.org/project/inline_entity_form/-/merge_requests/2...
proceeding to some tests
PS:
this issue is kinda related , tried to apply the same sort of rebase gaslighting but the branch is way behind the patch proposed and last proposed patch is trying to apply on a phantom commit (could'nt find the commit referenced in the index )
it should be closed in my opinion
Comment #35
marelpup commentedPS2: gitlab doesnt appreciate this trickery and generates a patch incompatible with "lockable" composer version , here is a patch of pure difference (not incremental as gitlab proposes)
Comment #36
marelpup commentedComment #37
svicer commentedI have tested the fix in the PR https://github.com/YCloudYUSA/yusaopeny/pull/292 in yusaopeny distro and can confirm patch #36 works correctly. The test involved creating a custom block from a landing page.
Error in logs Before Patch:
LogicException: Getting the base fields is not supported for entity type Menu. in Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions() (line 225 of /srv/drupal11/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php).Result:
Before patch: Adding a block generated a 500 error, and the AJAX request failed.
After patch: Adding a block works as expected.