Problem/Motivation

D8 provides a class interface for managing an Entities forms. This is a useful mechanism in and of itself as it allows inheritance through form classes, something which may enhance development of forms in D7. If a functionally identical class interface were present in D7, it would facilitate the migration of code base for custom Entities to D8.

Proposed resolution

Port the following D8 Interfaces to D7 in modules/entity/includes/entity.forminterface.inc (developers could opt-in by calling module_load_include('inc', 'entity', 'entity.forminterface'):

Provide backports of the following Class implementations:

Remaining tasks

  1. Create file structure entity.forminterface.info and entity.forminterface.module
  2. Backport FormInterface
  3. Backport BaseFormIdInterface
  4. Backport EntityFormInterface
  5. Backport FormBase
  6. Backport EntityForm
  7. Create Test equivalent of ./tests/Drupal/Tests/Core/Entity/EntityFormTest.php

User interface changes

None.

API changes

None - this would be a class structure that would allow optional use.

Data model changes

None.

Original report by [username]

n/a

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robertwb created an issue. See original summary.

robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Attaching rough implementation structure:

  • All interfaces added.
  • EntityForm class added.
  • FormBase class NOT added.
  • Not yet tested.