Genesis 2.0 Update – Catchable fatal error

Community Forums Forums General Discussion Genesis 2.0 Update – Catchable fatal error

This topic is: resolved

This topic contains 10 replies, has 6 voices, and was last updated by  Gary Jones 1 year, 4 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #54671

    NancyC
    Participant
    Post count: 1

    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!
    NancyC

    http://SEMOmarketingSolutions.com
    #54681

    Tombo
    Participant
    Post count: 4

    I 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!!!

    #54696

    Gary Jones
    Moderator
    Post count: 693

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


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

    • This reply was modified 1 year, 4 months ago by  Gary Jones.
    • This reply was modified 1 year, 4 months ago by  Gary Jones.
    #54701

    Tombo
    Participant
    Post count: 4

    That 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!!!

    #54705

    Tombo
    Participant
    Post count: 4

    The 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!!!

    #54712

    NancyC
    Participant
    Post count: 1

    Thank you so much for the help! I am running Copyblogger. I switch child themes often, but seem to always come back to Copyblogger. :-)

    #54725

    texasautoguide
    Participant
    Post count: 1

    Thanks @GaryJ

    #54751

    Gary Jones
    Moderator
    Post count: 693

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


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

    #54762

    sborsch
    Participant
    Post count: 1

    THANK YOU GaryJ. Your fix for *my* one broken client site worked!

    #54926

    raulcolon
    Participant
    Post count: 4

    I had the Issue on the Generate Theme… Worked for me thanks!

    #54974

    Gary Jones
    Moderator
    Post count: 693

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


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.