PHP Warning: Undefined array key “layoutHeader”

Hi there,

I posted this last year but unfortunately never got round to providing login details for you to have a look. Will provide access details in private posting,

Issue:

I’m getting a constant PHP error in my logs, relating to the Pro headers and footers. I have a single custom header and footer, both set to be applied to the whole site.

Here is the error:

[proxy_fcgi:error] Got error ‘PHP message: PHP Warning: Undefined array key “layoutHeader” in /var/www/vhosts/xxxx.co.uk/httpdocs/wp-content/themes/pro/cornerstone/includes/classes/Services/Assignments.php on line 103; PHP message: PHP Warning: Undefined array key “layoutFooter” in /var/www/vhosts/xxxx.co.uk/httpdocs/wp-content/themes/pro/cornerstone/includes/classes/Services/Assignments.php on line 107’

Getting similar error for the footer.

I’ve searched for an answer but find anything that helps.

Thanks in advance for any help!

Hello @ImpactDM,

Thank you for the inquiry.

We can’t reproduce the same issue on our end, so this is probably unique in your installation – perhaps, a plugin conflict. Please provide the site URL and login details in the private field, including the FTP login credentials, so we can check the issue.

Best regards.

Hi Ismael, thanks for your quick reply. I have added the login info on a secure note on my previous post. There is no FTP access as I’m running a VPS and don’t use FTP. Hopefully the wordpress login will be enough to take a look? Thanks.

Thank you for the info. We are not yet sure what’s causing the issue, but you can try replacing the getDocLayoutSetting function in the pro/cornerstone/includes/classes/Services/Assignments.php file with the following code: https://pastebin.com/ekXx0H6G

Let us know if the issue persists.

Many thanks for looking into this. Can I place that code into my child theme functions.php, or should I clone the assignments.php file into my child theme?
Thanks again

In this case, you will need to directly edit the Assignments.php file in the parent theme. We may add these changes in the upcoming patch if we can confirm that this resolves the issue.

Ok I will try this out and let you know the result. Many thanks!

So far so good - I will check again tomorrow to see if the error reappears. Thanks so much for your help on this.

Thank you for the confirmation. We’ll keep the thread open for updates.

Looks like your fix has done the trick - brilliant! Thank you so much.

You are most welcome @ImpactDM