Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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)
Comment | File | Size | Author |
---|---|---|---|
#12 | theme-table-bad-calls-workaround-3010394-12.patch | 900 bytes | dpovshed |
Comments
Comment #2
helmo CreditAttribution: helmo at Initfour websolutions commentedYes that sure looks like a php7 thing :)
Could it be that $variables['classes_array'] needs to be initialized below?
Comment #3
colanI tried replacing those lines with these, but no effect:
Only initializing the array without changing the other two lines has no effect either.
Is that what you meant?
Comment #4
helmo CreditAttribution: helmo at Initfour websolutions commentedNo that would be an array level too much... more like:
Comment #5
colanTried that already; didn't work for me. :(
Comment #6
Jon PughIt'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...
Comment #7
Jon PughLook 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:
'class' should be an array.
Never understood why Drupal 7 doesn't check and just make it an array.
Comment #8
Jon PughNope I'm wrong. class string works, so does array :D
Comment #9
Jon PughI'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()
Comment #10
colanThanks 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.
Comment #11
dpovshed CreditAttribution: dpovshed commentedMeanwhile 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.
Comment #12
dpovshed CreditAttribution: dpovshed commentedAn update - this one has more defensive code
Comment #13
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #14
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThis patch totally works for me to view the backups that I have.
Comment #15
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #16
helmo CreditAttribution: helmo at Initfour websolutions commentedI'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?