Closed (fixed)
Project:
Shortcode
Version:
7.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
5 Mar 2012 at 18:51 UTC
Updated:
2 Apr 2012 at 15:10 UTC
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
Comment #1
denes.szabo commentedThanks for the error report, Nick! I fixed this problem in the next release.
Comment #2
denes.szabo commented@Nick: a quick question - witch theme did you buy with shortcode support?
Comment #3
Nick Cash commented@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
Comment #4.0
(not verified) commentedFixed initial post formatting.