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.

Comments

pasqualle’s picture

Assigned: Andre3d » Unassigned
Status: Needs review » Postponed (maintainer needs more info)
Issue tags: -error, -fatal, -unsupported

can you tell me your PHP version?

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

pasqualle’s picture

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?

XiaN Vizjereij’s picture

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.

pasqualle’s picture

$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..

XiaN Vizjereij’s picture

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.

pasqualle’s picture

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.

pasqualle’s picture

The issue is without response. Closing..

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

pasqualle’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
wildcats1369’s picture

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

pasqualle’s picture

Version: 6.x-2.0-rc2 » 6.x-2.0-rc3
Status: Closed (fixed) » 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?

wildcats1369’s picture

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

pasqualle’s picture

installed the 6.10

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

sphism’s picture

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...

sphism’s picture

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.

pasqualle’s picture

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

Poieo’s picture

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

pasqualle’s picture

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..

pasqualle’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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