Fatal error: Unsupported operand types in admin.inc

Andre3d - January 24, 2009 - 12:40
Project:Quick Tabs
Version:6.x-2.0-rc3
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I get a Fatal error message when I try to use QT.

When I click configuration page I get...
Visit the configuration page to see the available styles and select the default style for your quicktabs.

Fatal error: Unsupported operand types in \sites\all\modules\quicktabs\includes\admin.inc on line 498

This is part of the file......
function quicktabs_settings() {
$styles = module_invoke_all('quicktabs_tabstyles');
// The keys used for options must be valid html id-s.
// Removing the css file path, because that can't be used.
foreach ($styles as $style) {
$options[$style] = $style;
}
ksort($options);

$form['quicktabs_tabstyle'] = array(
'#type' => 'radios',
'#title' => t('Quicktab styles'),
(498) '#options' => array('nostyle' => t('No style')) + $options,
'#default_value' => variable_get('quicktabs_tabstyle', 'nostyle'),
'#description' => t('Select the default style for quicktabs.'),
'#attributes' => array('class' => 'quicktabs-tabstyles clear-block'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}

When i click: New QT block:
Fatal error: Unsupported operand types in D:\www\zazizo.com\www\sites\all\modules\quicktabs\includes\admin.inc on line 97

This is part of the file.......
foreach ($styles as $style) {
$style_options[$style] = $style;
}
ksort($style_options);
$form['style'] = array(
'#type' => 'select',
'#title' => t('Style'),
(97) '#options' => array('nostyle' => t('No style')) + array('default' => t('Default style')) + $style_options,
'#default_value' => isset($quicktabs['style']) ? $quicktabs['style'] : 'default',
'#description' => t('Choose the quicktab style.'),
'#weight' => -6,
);

When I click Administer I get this at the top of the page:
* warning: ksort() expects parameter 1 to be array, null given in \sites\all\modules\quicktabs\includes\admin.inc on line 93.
* warning: ksort() expects parameter 1 to be array, null given in \sites\all\modules\quicktabs\includes\admin.inc on line 493.
* warning: ksort() expects parameter 1 to be array, null given in \sites\all\modules\quicktabs\includes\admin.inc on line 93.
* warning: ksort() expects parameter 1 to be array, null given in \sites\all\modules\quicktabs\includes\admin.inc on line 93.

I have no idea what to do with it.
Help would be appreciated, thanks in advance.

#1

Pasqualle - January 24, 2009 - 14:22
Assigned to:Andre3d» Anonymous
Status:needs review» postponed (maintainer needs more info)

can you tell me your PHP version?

you can find it on page admin/reports/status/php . It should be displayed in the header..

#2

Pasqualle - January 24, 2009 - 14:37

further review:
I think you are using a special style or a module which incorrectly implements the style hook.

if you have an own style copied into the tabstyles folder then can you give me the name of that style?
if you do not have an own style then can you search for the string "_quicktabs_tabstyles" in your installation?

is the admin/settings/quicktabs page displays similar errors?

#3

XiaN Vizjereij - January 26, 2009 - 11:37

I can confirm this error with PHP 5.2.8 and yes admin/settings/quicktabs shows the same error.

I messed a bit around with

(97) '#options' => array('nostyle' => t('No style')) + array('default' => t('Default style')) + $style_options

changed to

(97) '#options' => array('nostyle' => t('No style')) + array('default' => t('Default style')) + array($style_options)

Or after i initialized the $style_options with $style_options = array(); before the ksort the error goes away but the module did not work at all.

#4

Pasqualle - January 26, 2009 - 13:42

$style_options should be an array always

so I would like to know how did you make it a non array.
can you insert a

print_r($style_options);

before that line, and copy the displayed result into this issue.

and if you could answer the questions in #2 that would help also..

#5

XiaN Vizjereij - January 26, 2009 - 18:54

Hm ... now the error is gone.

At the time I tested the Quicktabs, i tried the RC2 and the 1.x version and both did not work.
Since that i only updated Administrator Menu from 1.1 to 1.3.

Here is my current config

Drupal 6.9
Administration menu 6.x-1.3
Content Construction Kit (CCK) 6.x-2.1
GeSHi Filter for syntax highlighting 6.x-1.1
insertFrame 6.x-1.4
link node 6.x-1.1
Pathauto 6.x-1.1
Quick Tabs 6.x-2.0-rc2
Search 404 6.x-1.4
Token 6.x-1.11
Views 6.x-2.2

Amadou 6.x-1.1

If i remember correct i had something customized on the Amadou theme at the time i tried QT. Now its a clean one.

Really strange ... But all QT features are working now.

#6

Pasqualle - January 26, 2009 - 19:20

I don't believe that the admin_menu could have any connection to QT styles..
I will keep this issue open for some more, maybe Andre3d will post a reply also.

#7

Pasqualle - February 25, 2009 - 21:51

The issue is without response. Closing..

Feel free to reopen the issue if the problem still exists.

#8

Pasqualle - February 25, 2009 - 21:55
Status:postponed (maintainer needs more info)» closed

#9

wildcats1369 - July 6, 2009 - 16:43

Im also having the same trouble,

Drupal 6.13 using quicktabs 6.x-2.0-rc3
Theme used is colourized

I tried to search for "_quicktabs_tabstyles" but didnt find anything

#10

Pasqualle - July 6, 2009 - 20:34
Version:6.x-2.0-rc2» 6.x-2.0-rc3
Status:closed» active

there must be something wrong with the files in the /tabstyles directory. Probably I should add an is_array() check, because $style_options must be an array..

do you see the styles on the admin/settings/quicktabs page?
do you have own tabstyle?

#11

wildcats1369 - July 9, 2009 - 04:10

I didnt make my own tabstyle ( probably colourize theme made them but i didnt checked if it does ) anyways i just installed the 6.10 and its now working

#12

Pasqualle - July 9, 2009 - 11:08

installed the 6.10

Drupal 6.10? Why? you should always use the latest Drupal release..

#13

sphism - July 14, 2009 - 11:00

I'm getting this same error, i'm using a zen sub theme and drupal 6.12, will switch to drupal 6.13 and see if that sorts it out...

#14

sphism - July 14, 2009 - 11:26

Yep, still getting this error with drupal 6.13

Still get it using my zen sub theme or standard garland...

I get this error:

# warning: ksort() expects parameter 1 to be array, null given in /var/www/sites/laptop/html/sites/all/modules/quicktabs/includes/admin.inc on line 485.
# warning: ksort() expects parameter 1 to be array, null given in /var/www/sites/laptop/html/sites/all/modules/quicktabs/includes/admin.inc on line 93.

#15

Pasqualle - July 18, 2009 - 03:22

do you see any error in watchdog before the ksort() error? admin/reports/dblog

#16

Poieo - September 17, 2009 - 17:44

Was a solution ever found to this issue? Having the same problem: 6.13 using the Zen theme.

#17

Pasqualle - September 17, 2009 - 19:55

the solution was found, just make the change in comment #3 and the error should be gone.
the problem is that the bug was not found.. I do not know why do you see this error.
I will probably make the change #3, but I would like to understand what is causing this problem..

#18

Pasqualle - October 2, 2009 - 21:00
Status:active» fixed

should be fixed now
http://drupal.org/cvs?commit=270450

#19

System Message - October 16, 2009 - 21:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.