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

Bricks for IEF #34

Merged
merged 5 commits into from
Apr 21, 2017
Merged

Bricks for IEF #34

merged 5 commits into from
Apr 21, 2017

Conversation

berdyshev
Copy link

No description provided.

@berdyshev
Copy link
Author

To be fixed:

  • Submit doesn't save values for depth field

@berdyshev
Copy link
Author

I've implemented saving of depth and options fields

bricks.edit.inc Outdated
@@ -102,7 +103,7 @@ function theme_bricks_tree_value_form($variables) {
drupal_add_tabledrag($table_id, 'depth', 'group', $element['#field_name'] . '-depth');
// Fake call to enable indentation:
drupal_add_tabledrag($table_id, 'match', 'parent', $order_class);
drupal_add_js(drupal_get_path('module', 'bricks') . '/bricks.js');
drupal_add_js(drupal_get_path('module', 'bricks') . '/bricks.js');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded indentation!

$entities['#theme'] = 'bricks_inline_entity_form_table';

foreach (element_children($entities) as $delta) {
$item = isset($context['items'][$delta]) ? $context['items'][$delta] : NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about to move this code in a helper function? Like in 8.x: https://github.com/highweb/drupal-bricks/blob/8.x-1.x/bricks.module#L233. And then use in both core module and bricks_inline.

*
* @see bricks_inline_field_widget_form_alter()
*/
function theme_bricks_inline_entity_form_table($variables) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I figured out- here we have a copy-paste from http:https://cgit.drupalcode.org/inline_entity_form/tree/inline_entity_form.module?h=7.x-1.8#n1659 + modifications similar to https://github.com/berdyshev/drupal-bricks/blob/7.x-5.x/bricks.edit.inc#L44.

Let's split this function in two parts:

  1. _template_preprocess_inline_entity_form_entity_table - copy-paste from IEF.
  2. _bricks_preprocess_tabledrag_form helper like in 8.x https://github.com/highweb/drupal-bricks/blob/8.x-1.x/bricks.module#L179.
  3. And then call 1) and 2) in bricks_inline_preprocess_inline_entity_form_entity_table like in 8.x: https://github.com/highweb/drupal-bricks/blob/8.x-1.x/modules/bricks_inline/bricks_inline.module#L25.

So, we can submit a patch in IEF and remove _template_preprocess_inline_entity_form_entity_table completely once accepted.

@tonystar tonystar merged commit 99e7840 into anydigital:7.x-5.x Apr 21, 2017
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