When navigating to a site's Backups page at http://aegir.example.com/node/99999/backups, I get:

Error: [] operator not supported for strings in theme_table() (line 2102 of /var/aegir/hostmaster-7.x-3.x-2018-09-20-1200/includes/theme.inc).

The Devel module's backtrace doesn't seem to work for this error so I'm having trouble tracking it down.

Looks similar to #2915550: PHP 7.1 compatibility and/or #1764028: Fatal error: [] operator not supported for strings in theme.inc on line 1983 though.

PHP version: 7.0 (Ubuntu 16.04)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

colan created an issue. See original summary.

helmo’s picture

Yes that sure looks like a php7 thing :)

Could it be that $variables['classes_array'] needs to be initialized below?

function eldir_preprocess_html(&$variables, $hook) {
  $node = menu_get_object();
  if (!empty($node)) {
    $type = $node->type;

    $variables['classes_array'][] = " node-page";
    $variables['classes_array'][] = " ntype-{$type}";
  }

colan’s picture

I tried replacing those lines with these, but no effect:

    $variables['classes_array'] = array();
    $variables['classes_array'][] = array(" node-page");
    $variables['classes_array'][] = array(" ntype-{$type}");

Only initializing the array without changing the other two lines has no effect either.

Is that what you meant?

helmo’s picture

No that would be an array level too much... more like:

    $variables['classes_array'] = array();
    $variables['classes_array'][] = " node-page";
    $variables['classes_array'][] = " ntype-{$type}";

colan’s picture

Only initializing the array without changing the other two lines has no effect either.

Tried that already; didn't work for me. :(

Jon Pugh’s picture

It's not the $variables, it's the arrays used in the theme_table() call.

[] operator not supported for strings in theme_table() (line 2102 of /var/aegir/hostmaster-7.x-3.x-2018-09-20-1200/includes/theme.inc).

One of the $headers or $rows has a string when it should be an array...

Jon Pugh’s picture

Look for the hook_menu item for node/%/backups: hosting_site_backup_manager_menu()
Look for the page callback: hosting_site_backup_manager_page()
This looks like it: $output .= hosting_site_backup_manager_backups_table($site);

Found it:


    $rows[] = array(
      'data' => $row,
      'class' => '',
    );

'class' should be an array.

Never understood why Drupal 7 doesn't check and just make it an array.

Jon Pugh’s picture

Nope I'm wrong. class string works, so does array :D

Jon Pugh’s picture

I'm not even seeing the error, so...

I would look for something in the Rows and Headers array in hosting_site_backup_manager_backups_table()

colan’s picture

Issue summary: View changes

Thanks for looking into it. The real problem is that Devel's backtrace doesn't show up for that error. Anyone have any ideas for how to get that working? Then we could actually track this thing down.

P.S. Just added the PHP version & OS in the summary. It would be good if someone else can reproduce it at least.

dpovshed’s picture

Meanwhile here is a Drupal core patch, applicable for both 7.63 and 7.65.

It may be useful for those who like me, need Backup functionality right now.

dpovshed’s picture

FileSize
900 bytes

An update - this one has more defensive code

SocialNicheGuru’s picture

Status: Active » Needs review
SocialNicheGuru’s picture

This patch totally works for me to view the backups that I have.

SocialNicheGuru’s picture

Status: Needs review » Reviewed & tested by the community
helmo’s picture

Status: Reviewed & tested by the community » Needs work

I'm not really eager to add core patches to Aegir. That has given extra maintenance work in the past when a patch no longer applies to the next core release.... and thus breaking Aegir installs which we intentionally do not pin to a specific release to Drupal 7.

Has this been reported in the core issue queue?