Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Issue summary: View changes
FileSize
2.17 KB
Berdir’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
@@ -9,12 +9,20 @@
  * Builds entity forms.
+ *
+ * This is like \Drupal\Core\Form\FormBuilderInterface but instead of a form_id
+ * it is based on an entity.

form_id => form class I'd say. And "... on an entity and operation."

And possibly append: "It will then look up the corresponding form class based that information."

chx’s picture

Status: Needs work » Needs review
FileSize
2.23 KB
642 bytes
chx’s picture

dawehner’s picture

+++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
@@ -9,12 +9,21 @@
+   * The form may also be retrieved from the cache if the form was built in a
+   * previous page-load. The form is then passed on for processing, validation

This is a little bit unclear as this is just true if the previous request was a POST one already.

chx’s picture

I copied that from existing documentation :) on FormBuiderInterface, I believe.

jhodgdon’s picture

Status: Needs review » Needs work

Looks good! A few small-ish suggestions:

  1. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -9,12 +9,21 @@
    + * This is like \Drupal\Core\Form\FormBuilderInterface but instead of supplying
    + * the form class directly it looks up the class based on an entity and an
    + * operation.
    

    So I think formBuilderInterface normally (or at least sometimes) would get the form from the ID, right?

    So maybe rewrite this as:

    ... instead of looking up the form class by class name or form ID, it looks up the form class based on the entity type and operation.

  2. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -9,12 +9,21 @@
    +   * previous page-load. The form is then passed on for processing, validation
    +   * and submission if there is proper input.
    +   *
    

    nitpick: serial comma (add a comma after "validation").

    Also I do not think page-load should have a hyphen in it.

  3. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -9,12 +9,21 @@
    +   *
    +   *
        * @param \Drupal\Core\Entity\EntityInterface $entity
        *   The entity to be created or edited.
    

    nitpick: only one blank line here.

  4. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -23,7 +32,17 @@
    +   *   where "book_outline" is the value of $operation. The relevant class can
    +   *   be found in the annotation of the entity under the form handlers, the
    +   *   $operation is the key, the value is the class defined there. For
    

    This is a comma splice (bad!). Replace the comma after "form handlers" with a ; and you'll be OK.

  5. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -23,7 +32,17 @@
    +   *     "storage" = "Drupal\node\NodeStorage",
    

    I think I would omit this line. Storage handlers are not relevant to this method.

chx’s picture

Status: Needs work » Needs review
FileSize
2.91 KB
jhodgdon’s picture

Status: Needs review » Needs work

Looks great to me except minor stuff...

  1. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -23,7 +31,15 @@
    +   *   section of the handlers entity annotation.For example:
    

    nitpick: needs space after .

  2. +++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
    @@ -36,6 +52,11 @@
    +   * @see book_entity_type_build()
    

    Is this supposed to be book_entity_type_build() or hook_entity_type_build() really?

  3. +++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
    @@ -70,7 +70,7 @@ public function getForm($form_arg);
    +   * previous pageload. The form is then passed on for processing, validation,
    

    is pageload a word? I think it would be "page load". ?

chx’s picture

Status: Needs work » Needs review
FileSize
2.92 KB
2.1 KB

> Is this supposed to be book_entity_type_build() or hook_entity_type_build() really?

Book. Changed to system to avoid confusion.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

This all looks good to me now, thanks! Setting to RTBC... there may be some other reviews though so maybe wait a day or two to commit?

tim.plunkett’s picture

+1 from me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

EntityFormBuilderInterface has received its love. Committed 9e9c0ac and pushed to 8.0.x. Thanks!

  • alexpott committed 9e9c0ac on 8.0.x
    Issue #2534926 by chx, jhodgdon: EntityFormBuilderInterface doxygen...

Status: Fixed » Closed (fixed)

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