Problem/Motivation

Rabbit hole functionality for block entities (Bean module).

Proposed resolution

Add a sub module rh_bean.

Remaining tasks

Develop. Commit. Party.

CommentFileSizeAuthor
#2 rabbit_hole-rh_bean-2773445-2-D7.patch6.05 KBminax.de
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

minax.de created an issue. See original summary.

minax.de’s picture

Status: Active » Needs review
FileSize
6.05 KB
seren10pity13’s picture

I'm using it for redirecting a bean page to front after editing, and it works as expected. Thank you very much !

seren10pity13’s picture

Hi, I had an issue when trying to remove an image from an image field : the process was blocked by a js error of type "drupalSetSummary() is not a function in rh-bean.js"...

So I adapted the patch provided for the same issue in rh-node:
https://www.drupal.org/node/2286867#comment-9507541

--- a/modules/rh_bean/rh_bean.module
+++ b/modules/rh_bean/rh_bean.module

function rh_bean_form_bean_admin_ui_type_form_alter(&$form, $form_state) {
  // Add the Rabbit Hole form.
  rabbit_hole_form($form, 'bean', $form['bean_type']['#value']->type, 'rh_bean');
+  if (isset($form['rabbit_hole'])) {
+    $form['rabbit_hole']['#attached']['js'][] = drupal_get_path('module', 'rh_bean') . '/rh-bean.js';
+  }
}
...
function rh_bean_form_bean_form_alter(&$form, $form_state) {
  // Add the Rabbit Hole form, and add an extra javascript file that's needed
  // for the fieldset summary.
  rabbit_hole_form($form, 'bean', $form['#entity']->type, 'rh_bean', $form['#entity']);
-  $form['#attached']['js'][] = drupal_get_path('module', 'rh_bean') . '/rh-bean.js';
+ if (isset($form['rabbit_hole'])) {
+    $form['rabbit_hole']['#attached']['js'][] = drupal_get_path('module', 'rh_bean') . '/rh-bean.js';
+ }

It removed the error and made the image field removal working correctly.
Hope it helps.

  • olofjohansson committed 5e44cf0 on 7.x-2.x authored by minax.de
    Issue #2773445 by minax.de,olofjohansson: Sub module for Block entities...
olofbokedal’s picture

Status: Needs review » Fixed

Had to change the way entities where retrieved when build RH for the entity form. Fetching from $form_state['bean'] instead.

Thanks for your work! Committed to 7.x-2.x.

Status: Fixed » Closed (fixed)

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