Cornerstone Broken by changing breakpoint ranges setting in Developer Toolkit

Hi, I attempted to change the Breakpoint Ranges using the Developer Toolkit within Cornerstone. The value changed from an array [ 480, 767, 979, 1200 ] to a string x_breakpoint_ranges and then everything started breaking. I tried to change the value back to the original array, but it won’t save. It keeps reverting back to the string.

Here is the error message:
Warning: array_map(): Expected parameter 2 to be an array, string given in /Users/colinsafranek/Local Sites/pinnacle-dev/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Breakpoints.php on line *25*

Same message for lines 25, 14, and 15 of Breakpoints.php

I need a way to restore the proper setting value so that I can get back to developing the site… Is the setting stored in the database somewhere?

In Breakpoints.php the default ranges are hardcoded like this:

public function defaultRanges() {
    return [ 480, 767, 979, 1200 ];
}

What I have done is changed line 25 from this:

public function breakpointRanges() {
    if ( ! isset( $this->ranges ) ) {
        $this->ranges = array_map( 'intval', apply_filters( 'cs_breakpoint_ranges', array_slice( $this->defaultRanges(), 0, 2) ) );
    }
    return $this->ranges;
}

to this:

public function breakpointRanges() {
    if ( ! isset( $this->ranges ) ) {
        $this->ranges = array_map( 'intval', array(480, 767, 979, 1200) );
    }
    return $this->ranges;
}

And this has allowed me to access the admin and cornerstone again, but I am still unable to change the breakpoint ranges setting back to the original array. No matter what I put as the value of that setting, it does not save, and reverts to the string x_breakpoint_ranges.

Sorry, I can’t share login info because this site is being developed locally (using Local WP). So I’ll need a description/instructions on how to reset the cornerstone breakpoint ranges setting manually.

Please help! Thank you very much in advance for saving my ass.

Hi Colin,

Thank you for writing in, to resolve this, rename your PRO folder first so it will deactivated. Then you need to go to your database, open the wp_options table, find the option_name x_breakpoint_ranges and reset the option_value of that to this a:4:{i:0;i:480;i:1;i:767;i:2;i:979;i:3;i:1200;}

Then rename back the PRO folder to pro and reactivate it.

Please note that we do not really provide support for any issue caused by a modification on the theme.

Cheers,

Thanks @friech, I followed your instructions and successfully changed the database value, and the change is now reflecting in the breakpoint ranges setting in cornerstone’s developer toolkit. Everything is working as expected now. Much appreciated!

Just to be clear, I was not attempting to modify the theme, but was trying to see if there was a way to customize the breakpoints. I’m assuming this is not an option. If that’s the case, can you please submit this as a feature request? It would be great to be able to create custom breakpoints that could be accessed in the Cornerstone builders, or at least customize the pixel values of the existing breakpoints.

Thanks again!

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.