I am filing this as support request since I cannot tell for sure they are a bug, but I am experiencing these problems with Mini Panels.

Issue #1: Cannot delete a Mini Panel. Just hit delete, I am asked if I am sure, then confirm. Only returns to the main MiniPanels list page and the one that I intended to delete is still there. No messages.

Issue #2: Mini Panels are OK in the preview or if added as a pane in a panel page. But as a block is not showing. There are no visibility rules. The block is set to show on all pages. Again, no error messages.

Issue #3: Creating a Mini Panel

Select a Layout. Hit Next and in Content there is no region shown
I go back to Layout and select a layout again and hit next. I get this message

warning: Invalid argument supplied for foreach() in .../modules/panels/includes/display-layout.inc on line 211

and all these messages when saving

    * warning: Invalid argument supplied for foreach() in .../modules/panels/includes/display-layout.inc on line 211.
    * warning: Invalid argument supplied for foreach() in .../modules/panels/panels.module on line 694.
    * warning: Invalid argument supplied for foreach() in .../modules/panels/includes/plugins.inc on line 417.

And no layout is generated

The way I found to generate the layout is:

- Start the creation select a layout
- provide name and title. Save and Proceed
- Click Save and Proceed in Context. Get to Content where there is no area to put content in.
- Go back to Settings. Nothing is shown in name and title nor in layout. Enter name and title and hit Save.
- Exit the edit forms and go to the Mini Panels list. You have the new MiniPanel with no layout shown.
- Hit Edit, go to layout, select the layout and when saving get the messages above.
- If you continue hitting save, the second time the messages does not appear and the layout is created (when you go to the content the regions is there). From here on I can change the layout without any messages. Seems to happen only the first time.
On PHPMyAdmin I can see that severan NULL Entries are created in the MiniPanels Table

Thank you.

CommentFileSizeAuthor
#12 422404-fix-mini-panels.patch5.03 KBmerlinofchaos

Comments

chawl’s picture

Category: support » bug
Priority: Normal » Critical

Exactly same issue, subscribing.

Almost nothing is working for mini panels. Alpha3 had also this very same problem.

Tx.

brambor’s picture

Same problem here - although it didn't appear until I updated to alpha 4 last night. I downgraded to alpha 3 and it works again.

Sancho Panza’s picture

Bambor, How did you downgrade? I removed the directory, installed the alpha3, did not run update.php. No luck. The problems are the same.

Sancho Panza’s picture

As far as I could get, I found something of why blocks are not being displayed.
On the implementation of hook_block (panels_mini_block) when option is 'view' the function that is called is

$panel_mini = panels_mini_load($delta);
this returns an empty variable

On function panels_mini_load the ctools function for querying table "panels_mini" is called on this sentence.

$result = ctools_export_load_object('panels_mini', 'names', array($name));

The arguments should match the key defined in the schema for the table 'panels_mini'. The problem is that the key is 'name' and we are sending the $delta that should be matched against 'pid'

By making the following modification to export.inc in ctools/includes I could get mini panels to work. Still cannot delete the existing mini panels

It is not a nice one, is done in another module, but at least I don't have to revert to alpha2 and rebuild everything (I learned the hard way to backup the database previous to updates)

function ctools_export_load_object($table, $type = 'all', $args = array()) {
  static $cache = array();
  static $cached_defaults = FALSE;
  static $cached_database = FALSE;

  $schema = ctools_export_get_schema($table);
  $export = $schema['export'];

/*************************************************************/
/* this is the fix */ 
  if (($table == 'panels_mini')&&(is_numeric($args['0']))) {
    $export['key'] = 'pid';
  }
/*************************************************************/

  if (!isset($cache[$table])) {
    $cache[$table] = array();
  }

  $return = array();

qbnflaco’s picture

I'm getting the same issues with node panels...

* warning: Invalid argument supplied for foreach() in .../modules/panels/panels.module on line 694.
* warning: Invalid argument supplied for foreach() in .../modules/panels/includes/plugins.inc on line 417.
* warning: Invalid argument supplied for foreach() in .../modules/ctools/includes/export.inc on line 255.

I updated to the latest ctools and alpha4 of panels and I still get the errors.

brambor’s picture

Sancho,

I don't claim to be an expert, so I wouldn't necessarily recommend doing anything the way I have!

All I did was delete the panels folder and replace it with the alpha 3 version. Then I ran update.php, even though it didn't see any new updates. I'm sure I also cleared the cache as well.

That seemed to do the trick for me, hope it is of some help.

int’s picture

same issue

qbnflaco’s picture

@bambor - did you also downgrade ctools?

chawl’s picture

Title: Several Issues with Mini Panels » Severe Issues with Node/Mini Panels
brambor’s picture

@qbnflaco

Nope. I didn't downgrade ctools. My install is currently running:
Chaos tool suite 6.x-1.0-alpha3
Panels 6.x-2.0-alpha3
Views 6.x-2.3

qbnflaco’s picture

FYI: I updated to dev and no longer have issues with the node panels, but am experiencing the same issues as you guys with the mini panels.

merlinofchaos’s picture

Status: Active » Fixed
StatusFileSize
new5.03 KB
Sancho Panza’s picture

Thank you, works perfectly!!
As we say around here: Eres un grande.

cgillogly’s picture

Status: Fixed » Active

After applying the patch, I'm still getting the error, but in different files. I'm getting the following both when I try to edit the content for the mini panel and after getting it there, when I try to display the page with that mini panel on it. It works correctly when I have a layout like two column, but gives me the errors when the flexible layout, which is what I use for almost everything :(

* warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 569.
* warning: Division by zero in /var/www/drupal/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 624.
* warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 655.
* warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 319.

Hopefully this can be easily patched and quickly.

merlinofchaos’s picture

Status: Active » Fixed

I'm 90% sure that's a different bug that results when you try to add a 'fixed' element as the first element in an empty row. I need to fix that =)

merlinofchaos’s picture

In any case, the answer is simple. Don't add a fixed element first, and if you did, you should be able to remove it okay.

cgillogly’s picture

@merlinofchaos All of the elements I have added in my mini panels, and panels for that matter, are fluid, not fixed. I use flexible layout for everything and fluid elements with percentages in my setup. After applying the patch above I am able to create and modify my mini panels without problem, but I have to use one of the standard layouts and not flexible or I get the error I posted above.

bacchus101’s picture

Edit: Created new issue.

Status: Fixed » Closed (fixed)

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