isVar in global size parameter lead to Warning: Undefined array key

I have two warnings in my local dev environment:

**Warning** : Undefined array key "_bp_data4_4" in  **.../cornerstone/includes/classes/Services/Tss.php**  on line  **111**

**Warning** : Array to string conversion in  **.../cornerstone/includes/classes/Tss/Reducers/DeclarationReducer.php**  on line  **56**

What happend:

I have two values as global size parameters I control the section margins with. (see screenshot below)
No I tried to add isVar to these margin values, to make the sizes smaller on smaller devices.

First thing I noticed, I was not able to fill out the values for each breakpoint. It stopped input after the first number and did not save it. Somehow I managed to fill in the values by resetting all breakpoint values and then entering the values from the smallest breakpoint up to the desktop breakpoint.

But the tests showed, that the section margins didn’t not change when I checked in the browser. So I reverted the isVar. And since then I get these warnings.

If I re-add the isVar, then the key from the warning _bp_data4_4 shows up again in the Theme Options State (see second screenshot). So I’m pretty sure it does relate, but how can I fix this? The _bp_data4_4 seems to be stuck somewhere. Clearing Cornerstone Cache did not work.


I think using a group plus isVar causes that warning. I don’t think there is a way around that without removing the data manually too as you see in the state, then pressing the “Apply” button. The system isn’t setup to handle groups and isVar right now for Global Parameters. We’ll get that fixed though in the Pro6.5 beta. Thanks for the info have a great day.

Thanks for your feedback @charlie.

I tried to delete the “_bp_base”: “4_4” and the _bp_data4_4 object, pressed apply. But after a browser reload they are back again. And at least the Array to string conversion warning in DeclarationReducer.php stays.

Did I miss a step?

So after you do that in the Theme Options State, try changing one of your parameter value. Then press save after that. I think it doesn’t register a change so it doesn’t send anything to save. Let me know if that helps and have a great weekend.

Thank you @Charly!
Yes, that fixed the problem and the warning is gone :+1:

1 Like