Problem/Motivation

The extra fields are not being cloned correctly, they are not located in their correct regions (content, hidden).

Steps to reproduce

  • Create extra fields with the hook, hook_entity_extra_field_info for NodeType in form display.
  • Mark the extra fields visible=FALSE.
  • Set visibility to visible throughth of UI.
  • Clone the entity entity type.
  • Check out the extra fields must be visible (content) and appear hidden (hidden).
    $extra['node'][$bundle->id()]['display']['my_extra_field'] = [
      'label' => t('Extra field label'),
      'visible' => FALSE,
      'weight' => 5,
    ];

Proposed resolution

Adjust, create MR or patch.

CommentFileSizeAuthor
#10 3452646-10.patch6.3 KBvuil
Command icon 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

dmezquia created an issue. See original summary.

dmezquia’s picture

Issue summary: View changes
dmezquia’s picture

Issue summary: View changes

dmezquia changed the visibility of the branch 3452646-the-extra-fields to hidden.

dmezquia changed the visibility of the branch 3452646-the-extra-fields to active.

dmezquia’s picture

Status: Active » Needs review
dmezquia’s picture

What the MR does is to initially set the extra fields of the source entity in the destination entity, maintaining the same order of the source and the same location.

Patch: https://git.drupalcode.org/project/entity_type_clone/-/merge_requests/10...

vuil’s picture

Version: 4.0.3 » 4.0.x-dev
Category: Support request » Task
vuil’s picture

StatusFileSize
new6.3 KB
vuil’s picture

Status: Needs review » Reviewed & tested by the community

  • vuil committed 53fbdb54 on 4.0.x
    Issue #3452646 by dmezquia, vuil: The extra fields are not cloned...
vuil’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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