Shortcode was part of a theme I bought for a work project, and I have to say I like it quite a lot. However, our pages were generating a lot warnings:

Strict warning: Creating default object from empty value in _shortcode_process() (line 135 of /home/drupal/sites/all/modules/shortcode/shortcode.module).

This was the function in question:

    130 function _shortcode_process($text, $filter) {
    131   $shortcodes = shortcode_list_all();
    132   $shortcodes_enabled = array();
    133   foreach($filter->settings as $name => $value) { // run through all shortcodes
    134     if($value && $shortcodes[$name]['process callback']) {
    135       $shortcodes_enabled[$name]->enabled = TRUE;
    136       $shortcodes_enabled[$name]->function = $shortcodes[$name]['process callback'];
    137     }
    138   }

I put $shortcodes_enabled[$name] = new StdClass; before 135 and it seems to have fixed the warnings.

Comments

denes.szabo’s picture

Assigned: Unassigned » denes.szabo
Status: Active » Fixed

Thanks for the error report, Nick! I fixed this problem in the next release.

denes.szabo’s picture

@Nick: a quick question - witch theme did you buy with shortcode support?

Nick Cash’s picture

@Denes.Szabo -- Sorry for the late reply. The module is used in the Glossy theme by dropletz. You can find it on ThemeForest here: http://themeforest.net/item/glossy-modern-drupal-theme/1559039

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Fixed initial post formatting.