soberwp / controller

Composer package to enable a controller when using Blade with Sage 9
MIT License
368 stars 43 forks source link

Acf Module Warning when no ACF fields on page #102

Closed lhilton closed 5 years ago

lhilton commented 6 years ago

On some pages a warning will be shown when a given page has not ACF fields. The message is:

Warning: array_merge(): Argument #2 is not an array in /sites/testsite.test/www/wp-content/themes/testtheme/vendor/soberwp/controller/src/Controller.php on line 151

The issue is that in Module/Acf.php it is possible for the setData() function to set $this->data to a boolean false, I am guessing this is done one line 77 specifically. Because of my stack I cannot simply disable this on a per-template basis. After reviewing the code, it appears that $this->data should always be an array anyways.

darrenjacoby commented 6 years ago

I have noticed this and also wrote a fix, I'll compare with your PR to resolve this weekend.

adviva commented 6 years ago

Hi there! Any update?

darrenjacoby commented 6 years ago

@adviva this weekend. Last weekend was my birthday so it got away from me as they do.

adviva commented 6 years ago

@darrenjacoby thank you for replying me and happy b day 😄 🎉

darrenjacoby commented 5 years ago

@adviva I've included this in the next release, but still working on some other issues before tagging.

pfalomo commented 5 years ago

thank you @darrenjacoby