It'd be useful if Bean had Panelizer integration, so that the beans could be rendered using Panelizer. See #1820442: Panelizer for Comments for example code for the Comment entity.

Comments

acrollet’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new5.63 KB

Patch attached, review appreciated.

acrollet’s picture

Status: Reviewed & tested by the community » Needs review

argh, wishful thinking on the status!

jwilson3’s picture

  1. +++ b/plugins/entity/PanelizerEntityBean.class.php
    @@ -0,0 +1,140 @@
    +  public function entity_access($op, $entity) {
    ...
    +  public function entity_identifier($entity) {
    ...
    +  public function entity_bundle_label() {
    

    Needs docblock comment.

  2. +++ b/plugins/entity/PanelizerEntityBean.class.php
    @@ -0,0 +1,140 @@
    +    // This must be implemented by the extending clas.
    

    spelling.

  3. +++ b/plugins/entity/PanelizerEntityBean.class.php
    @@ -0,0 +1,140 @@
    +  function get_default_display($bundle, $view_mode) {
    +    return parent::get_default_display($bundle, $view_mode);
    +  }
    

    Needs docblock comment, but also, a question: why does this have to be implemented only to call the parent?

acrollet’s picture

StatusFileSize
new5.67 KB

new patch attached, thanks for the feedback.

acrollet’s picture

StatusFileSize
new5.68 KB

New patch attached with a bit of cleanup based on comments from jwilson3.

jwilson3’s picture

On /admin/config/content/panelizer, when you first click to enable panelizer for a given bean type, if you don't also click the "Default" checkbox... the panelizer ui doesn't show any view modes, and there is no way to get it back. The workaround is to first go specifically enable the "Default" view mode on Admin > Structure > Block Types > {your block type} > Manage Display, under "Use custom display settings for the following view modes".

But for instance with nodes, the Article node type with a clean Drupal install only has "Teaser" checked under "Use custom display settings for the following view modes"
but then on /admin/config/content/panelizer, under Article, it shows rows for Full page, Default, and Teaser.

So it seems like there is some extra code somewhere that ensures that even if Default is unchecked, (for nodes at least) that it still shows up in the panelizer config page.

We should find that code and copy it for beans as well, to save the extra hassle of clicking around in the UI, and head scratching.

damienmckenna’s picture

Status: Needs review » Needs work

This needs a small amount of work to handle the new structure for entity_allows_revisions:

  /**
   * Determine if an entity allows revisions and whether or not the current
   * user has access to control that.
   *
   * @param $entity
   *   The entity in question.
   * @return
   *   An array. The first parameter is a boolean as to whether or not the
   *   entity supports revisions, the second parameter is whether or not the
   *   user can control whether or not a revision is created, the third states
   *   whether or not the revision is created by default.
   */
  public function entity_allows_revisions($entity);
acrollet’s picture

Status: Needs work » Needs review
StatusFileSize
new5.7 KB

updated entity_allows_revisions().

acrollet’s picture

StatusFileSize
new5.75 KB

Arrgh, #8 was based on an older patch, ignore that and review this, please.

friera’s picture

#9 works for me.

Thanks

indytechcook’s picture

Status: Needs review » Fixed

Thanks pushed to 7.x-1.x

  • indytechcook committed d4a63b9 on 7.x-1.x authored by acrollet
    Issue #2161535 by acrollet, DamienMcKenna, jwilson3: Panelizer support...

Status: Fixed » Closed (fixed)

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