-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding dynamic entity reference tree inline widget #39
Conversation
@@ -11,3 +13,30 @@ | |||
function bricks_dynamic_preprocess_field_multiple_value_form(&$variables) { | |||
_bricks_preprocess_tabledrag_form($variables, 'element', 'bricks_tree_dynamic', $variables['element']['#field_name'] . '-delta-order'); | |||
} | |||
|
|||
function bricks_dynamic_inline_entity_form_reference_form_alter (&$reference_form, $form_state) { | |||
$triggering_element = $form_state->getTriggeringElement(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2-spaces formatting!
bricks.module
Outdated
@@ -109,6 +109,9 @@ function _bricks_nest_items($element, $items) { | |||
} | |||
|
|||
if ($parent_delta != -1) { | |||
if (count($items[$parent_delta]['childs']) <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to remove this and catch the error!
@@ -11,3 +13,30 @@ | |||
function bricks_dynamic_preprocess_field_multiple_value_form(&$variables) { | |||
_bricks_preprocess_tabledrag_form($variables, 'element', 'bricks_tree_dynamic', $variables['element']['#field_name'] . '-delta-order'); | |||
} | |||
|
|||
function bricks_dynamic_inline_entity_form_reference_form_alter (&$reference_form, $form_state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space _alter (&$reference_form
!
* label = @Translation("Bricks tree Dynamic (Inline entity form)"), | ||
* description = @Translation("A tree of inline entity forms."), | ||
* field_types = { | ||
* "bricks", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
* description = @Translation("A tree of inline entity forms."), | ||
* field_types = { | ||
* "bricks", | ||
* "bricks_revisioned", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
{ | ||
$name = $this->fieldDefinition->getName(); | ||
|
||
if (isset($_POST[$name]['actions']['entity_type'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add comment with TODO!
No description provided.