Skip to content

Cloning FieldsetOpen doesn't clone END field #491

@BitPoet

Description

@BitPoet

Short description of the issue

When you clone a FieldsetOpen field, the corresponding FieldsetClose field isn't created.

Expected behavior

Since deleting and adding fields in the backend also affects FieldsetClose fields, the same should be true for cloning.

Optional: Suggestion for a possible fix

Creation of the corresponding close field happens through a hook to ProcessField::fieldAdded, but that isn't triggered when cloning a field. This could be fixed by adding two lines starting at Line 1658 of ProcessFields.module:

						$clone->set('closeFieldID', null);
						$this->fieldAdded($clone);

Since closeFieldID is copied, it has to be nulled so the hook in FieldtypeFieldsetOpen creates the closing field.

Setup/Environment

  • ProcessWire version: 3.0.90

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions