evertiro / historical-redux2

A simple, easily extendable options framework for WordPress based on NHP Theme Options Framework.
http://reduxframework.com
Other
105 stars 43 forks source link

php error in defaults.php (just updated) #136

Closed Pushplaybang closed 11 years ago

Pushplaybang commented 11 years ago

hey Guys

just updated the redux files in my theme framework with the latest version and I get the following 2 errors appearing in the options sidebar (note that wp_debug is set to true in my wp-config)

in the import / export box : Notice: Undefined index: import_icon_type in /Applications/MAMP/htdocs/Starter-Theme/wordpress/wp-content/themes/nona-start/functions/options/defaults.php on line 662

and in the dev mode box : Notice: Undefined index: dev_mode_icon_type in /Applications/MAMP/htdocs/Starter-Theme/wordpress/wp-content/themes/nona-start/functions/options/defaults.php on line 693

don't wanna get to trigger happy with patching the defaults.php unless thats totally neccessary.

Note that I didn't update my custom options yet.

Let me know if I'm doing something wrong.

Cheers.

evertiro commented 11 years ago

It's distinctly possible that I missed a check in the defaults section. Referencing a non-existent variable will always cause this kind of error, and I've found a few of them in the past that required a tweak to prevent similar errors. Please feel free to submit a patch, or I'll get to it shortly!

Pushplaybang commented 11 years ago

awesome thanks for the quick response, I'll take a swing at it - pretty sure I've fixed this same error before - for myself - either in NHP or another helper class I'm using........

thanks for all the awesome work you're doing on this framework man - its seriously still the best options framework out by miles.....

Pushplaybang commented 11 years ago

Also.....themecheck is returning this

REQUIRED: defaults.php. Themes should use add_theme_page() for adding admin pages. Line 184: $this->page = add_submenu_page( Line 206: add_submenu_page($this->args['page_slug'], $this->args['page_title'], '', $ Line 209: add_submenu_page( Line 219: add_submenu_page( Line 229: add_submenu_page( Line 239: add_submenu_page(

Should I try fix this as well?

Pushplaybang commented 11 years ago

okay - I'm being stupid - id some reading - just seems to be about wordpress wanting theme option pages under the appearance menu - not a real issue.

Pushplaybang commented 11 years ago

okay fixed this on lines 662 and 693 in defaults.php both conditionalis should have $this->args['icon_type']

seems to do the trick

Pushplaybang commented 11 years ago

pull request submitted....

evertiro commented 11 years ago

Nope, that doesn't fix it. Both import_icon_type and dev_mode_icon_type are valid config options. The problem is that by default they aren't set, so checking their value throws an error. The correct fix would be as follows:

if( isset( $this->args['import_icon_type'] ) && $this->args['import_icon_type'] == 'image' )

Pushplaybang commented 11 years ago

he jumps, he shoots, he fails :( - lol, nice one ghost, I feel like a douche, but thanks for the patch :).

evertiro commented 11 years ago

Fixed in 3.0.0