When editing points from the referencing entity, we'd like to use Inline Entity Form, otherwise, it's not usable. Let's add the dependency, and make IEF the default widget for the field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skyredwang created an issue. See original summary.

谢艳’s picture

Assigned: Unassigned » 谢艳
Status: Active » Needs review
FileSize
314 bytes
skyredwang’s picture

Status: Needs review » Needs work

We need a solution to make IEF the default widget for the entity reference to points.

谢艳’s picture

Component: Code » User interface
FileSize
1.43 KB

when points ref field add, entity-form-display-form default widget only has IEF, but when edit node or user ,point form still displays autocomplete ,

skyredwang’s picture

+++ b/points.module
@@ -31,3 +31,21 @@ function points_add_number_field(PointTypeInterface $type, $label = 'points') {
+          //          dpm($option, $field_name);

Please remove the debugging line.

OK. This patch might be what we need, but we need more. We need to implement PointInlineForm.php, otherwise, IEF won't know what form to use for PointEntity. I don't see IEF picking up any default form for PointEntity, do you?

skyredwang’s picture

Status: Needs work » Needs review

IEF won't know what form to use for PointEntity. I don't see IEF picking up any default form for PointEntity, do you?

This problem was fixed by #2883735: Convert the number field to be configurable

skyredwang’s picture

Status: Needs review » Needs work
+++ b/points.module
@@ -31,3 +31,21 @@ function points_add_number_field(PointTypeInterface $type, $label = 'points') {
+function points_form_entity_form_display_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {

This is not a legit Drupal hook.

dravenk’s picture

Assigned: 谢艳 » dravenk
Status: Needs work » Needs review
FileSize
683 bytes

Remove the deprecated method

skyredwang’s picture

Status: Needs review » Needs work

No. these are necessary to get IEF to work.

  • skyredwang committed da69dee on 8.x-1.x
    Issue #2884539 by 谢艳, dravenk, skyredwang: Use IEF for points widget
    
skyredwang’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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