Skip to content
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

Merged
merged 8 commits into from
Mar 19, 2018

Conversation

danielbeeke
Copy link
Contributor

No description provided.

@@ -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();
Copy link
Collaborator

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) {
Copy link
Collaborator

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) {
Copy link
Collaborator

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",
Copy link
Collaborator

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",
Copy link
Collaborator

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'])) {
Copy link
Collaborator

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!

@tonystar tonystar merged commit 2dc98d4 into anydigital:8.x-1.x Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants