Comments

ruslan_03492 created an issue. See original summary.

anavarre’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev

Yes, same request here. The module works fine when creating a regular node but in the context of an inline_entity_form creation the node title will be displayed.

What happens is that you can add a random node title and it will be successfully replaced as expected, but that's a pretty ugly workaround and certainly not optimal from a UX perspective.

sutharsan’s picture

Priority: Normal » Major

Since a note title is a required field, this bug makes it impossible to add data that has a hidden title field. Therefore I'm raising the priority to Major.

jonathanshaw’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.94 KB

I don't know if this is optimal, but it's simple, lightweight and works for me.

We need to use IEF's own form alter hook, and allow for the fact that for IEF child forms $formState->getFormObject()->getEntity() returns the parent entity, not the child one, where as $form['#entity'] holds the child.

geraldito’s picture

Thanks @jonathanshaw ,patch from #4 works fine for me.

sutharsan’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks Ok and works as expected.

peacog’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.8 KB

Re-rolled after recent commits

giorgosk’s picture

Status: Needs review » Needs work

#7 does not apply to latest dev version or latest beta1

Checking patch auto_entitylabel.module...
error: while searching for:
/**
 * Implements hook_form_alter().
 */
function auto_entitylabel_form_alter(&$form, FormStateInterface $form_state) {
  if (isset($form['#entity_builders']) && empty($form['#auto_entitylabel_processed'])) {
    $decorator = \Drupal::service('auto_entitylabel.entity_decorator');
    /** @var \Drupal\auto_entitylabel\AutoEntityLabelManager $entity */
    $entity = $decorator->decorate($form_state->getFormObject()->getEntity());

    if ($entity instanceof AutoEntityLabelManagerInterface) {
      if ($entity->hasAutoLabel()) {

error: patch failed: auto_entitylabel.module:45
error: auto_entitylabel.module: patch does not apply

#4 applies cleanly with just a warning

2848128-4.patch:21: trailing whitespace.
    
Checking patch auto_entitylabel.module...
Applied patch auto_entitylabel.module cleanly.
warning: 1 line adds whitespace errors.

but its not really working as it should

one must input something on the title field to get passed validation and later on the autolabel is created

peacog’s picture

Status: Needs work » Reviewed & tested by the community

My mistake - the patch from #4 applies just fine against 8.x-2.x. I was still on 8.x-1.x. I'm removing the patch from #7 and reverting status to RTBC.

giorgosk’s picture

Status: Reviewed & tested by the community » Needs review

I just said #4 applies but does not work
I think it needs to be reviewed before commited

jonathanshaw’s picture

#4 works OK for me. Can you say more, can you give steps to reproduce what you see as "not working"?

dman’s picture

Looking for this today.
inline_entity_form is actually my main and only reason for wanting to use this module, as I have a 'joiner' node that's just a data holder, and the title is actually irrelevant to the item at edit time.

sutharsan’s picture

None of the patches still apply to 8.x-2.x.

Re-rolled and made the following changes:
- Changed the order of the functions. First the hook_form*_alter() then the auto_entitylabel_prepare_entityform()
- Moved if ($form_entity instanceof ContentEntityInterface) to hook_form_alter(). No need for this check in hook_inline_entity_form_entity_form_alter() as IEF only works with content entities.
- Removed if ($entity instanceof AutoEntityLabelManagerInterface) because $decorator->decorate() always returns AutoEntityLabelManager.
- Added docblock comment to auto_entitylabel_prepare_entityform().

sutharsan’s picture

StatusFileSize
new4.02 KB
ribel’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed and tested patch #13 and it works good for me with IEF + ECK.

yobottehg’s picture

Status: Reviewed & tested by the community » Needs work

this patch needs a rebase because it does not apply on 8.x-2.x anylonger

ribel’s picture

Status: Needs work » Reviewed & tested by the community

@yobottehg, This patch is not needed anymore because it was merged to 8.x-2.x-dev with another patch.
See related issue and this commit.

@RenatoG, could you close this issue, and set the credits?

sutharsan’s picture

I support call to correct the missing credits. See #2896979-6: Add an option to automatically prefill the label

pepemty’s picture

Hello. Great work here with this module. Thanks, really.

What about pushing the most recent dev into the next Beta so Composer can pick it up...?

Warm regards from sunny México.
: )

purushotam.rai’s picture

As verified, this issue has been fixed in the other issue, I understand that the commit credit could have been more organized, but reverting things will make it complicated and hence I feel we should move forward setting up apt credits now.

Kindly let me know if we are not on the same page. Thanks to all for all your inputs, it's definitely very valuable to the community and the module.

Thanks and Regards

purushotam.rai’s picture

Status: Reviewed & tested by the community » Fixed

Marking the issue as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.