Community Forums › Forums › Archived Forums › General Discussion › Genesis 2.0 Update – Catchable fatal error
- This topic has 10 replies, 6 voices, and was last updated 10 years, 8 months ago by Gary Jones.
-
AuthorPosts
-
August 7, 2013 at 1:30 pm #54671NancyCMember
I work on about 20 Genesis-based sites and only had a problem upgrading to 2.0 on this one site. Here's the error message:
Catchable fatal error: Argument 3 passed to Genesis_Settings_Sanitizer::add_filter() must be an array, string given, called in /home1/nancc/public_html/SEMOmarketingSolutions.com/wp-content/themes/genesis/lib/classes/sanitization.php on line 287 and defined in /home1/nancc/public_html/SEMOmarketingSolutions.com/wp-content/themes/genesis/lib/classes/sanitization.php on line 69
Can someone put that in English for me? The error message has blocked me from the WP dashboard but my site is still live.
Thanks!
http://SEMOmarketingSolutions.com
NancyCAugust 7, 2013 at 2:21 pm #54681TomboParticipantI am having the same issue and it was suggested that it may be a plugin. If you can list your plugins I can see what we have in common and maybe we can figure it out by deduction.
I want the old forums back!!!
August 7, 2013 at 2:40 pm #54696Gary JonesMemberOK, try this - it's a hack to Genesis (which you should never normally do, but if I'm correct, I'll make sure the same fix is applied to core, so that when you update, the fix is persisted.)
Open up genesis/lib/classes/sanitization.php and jump to line 69 - you should see:
function add_filter( $filter, $option, array $suboption = null ) {
Remove the word "array" from that third parameter, so you're left with:
function add_filter( $filter, $option, $suboption = null ) {
Save the file and upload to your site. Activate your theme, and check all is working.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
August 7, 2013 at 2:45 pm #54701TomboParticipantThat worked! Thanks! I did receive one through support I am going to try as well. That one is theme specific for AgentPress.
I want the old forums back!!!
August 7, 2013 at 2:52 pm #54705TomboParticipantThe AgentPress specific fix also worked. Anyone looking to modify the theme instead of core should do the following...
Using FTP or a web based file manager open the functions.php file.
Next, find and remove the following line:
require_once( get_stylesheet_directory() . '/lib/style.php' );
Add the following code to functions.php:
//* Create additional color styles add_theme_support( 'genesis-style-selector', array( 'agentpress-gray' => __( 'AgentPress Gray', 'agentpress' ), 'agentpress-green' => __( 'AgentPress Green', 'agentpress' ), 'agentpress-red' => __( 'AgentPress Red', 'agentpress' ), 'agentpress-tan' => __( 'AgentPress Tan', 'agentpress' ) ) );
Note: I added the last section to the end of the file.
I hope that helps.
I want the old forums back!!!
August 7, 2013 at 3:21 pm #54712NancyCMemberThank you so much for the help! I am running Copyblogger. I switch child themes often, but seem to always come back to Copyblogger. 🙂
August 7, 2013 at 3:42 pm #54725texasautoguideMemberThanks @GaryJ
August 7, 2013 at 5:16 pm #54751Gary JonesMemberTombo - yes, that would work as well, but if you happen to switch to another theme that has the same problem, then you'll have to apply your fix again. My solution jumps right to the source of the problem, and it's already been fixed in Genesis trunk, so it will definitely be in the next version.
For those interested, the problem tends to be with old themes that include a colour selector, and have been updated since Genesis 1.7 ( July 2011), which is when the Sanitization class was introduced. The style.php file includes a call to genesis_add_option_filter() with the third argument being a string. (Another solution is to turn this string into an array with a single string item).
Since Genesis 2.0, Genesis says that the third argument MUST be an array. Since it isn't, it throws a wobbly and dies. My fix above removes that type hint "MUST", so that it also allows strings as well, which it always should have done. The trouble here was that the documentation on line 66 was incorrect, stating that it should only accept an array, not a string or an array.
What the StudioPress fix does is update your theme, so that instead of rolling your own color selector (including sanitizing of values), you activate the one already built-in to Genesis, with a few colour options.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
August 7, 2013 at 6:09 pm #54762sborschMemberTHANK YOU GaryJ. Your fix for *my* one broken client site worked!
August 8, 2013 at 9:23 am #54926raulcolonMemberI had the Issue on the Generate Theme... Worked for me thanks!
August 8, 2013 at 10:33 am #54974Gary JonesMemberFor those who want to read up a little more, I've written http://gamajo.com/type-hint-bug/ (and just added Generate to the list of themes that are affected).
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.