Fatal error: Call to undefined function array_intersect_key() in /home/smith/web/home/sandbox/smithcms/modules/og_blueprints/helptext.inc on line 116

I just need some direction on how to troubleshoot this.

Comments

sdboyer’s picture

I'm 99% sure that this is because you're running PHP < 5.1. array_intersect_key() was only introduced in PHP5.1; I really ought to figure out a way of eliminating the call to it - but if it's possible for you to upgrade your PHP version to a more recent version of PHP5, that'll also take care of it.

sdboyer’s picture

Status: Active » Closed (works as designed)
jackspiv’s picture

Hi,

I've been loving OG Collections and have it working pretty well for me. Wanted to upgrade to blueprints, but I am on PHP 5.0.4.

Project page notes says that Blueprints plays on PHP 5.0 but prefers 5.1 and higher.

does it actually work with PHP < 5.1 or is this a dealbreaker? If it does work, what is the impact of the above error?

thanx

jackspiv’s picture

I just tried installing blueprints and get the same error as jefbak2.

I looked in my database and all of the mysql tables associated with blueprint are empty.

sdboyer’s picture

Status: Closed (works as designed) » Active

So, to clarify - yes, at the moment, OG Blueprints actually requires PHP 5.1. Because that use of array_intersect_key() is really a convenience thing, not a performance-need or a necessity or anything, I will eliminate it so that any version of php5 can run blueprints. I'm _completely_ swamped with Panels and a project right now, so I'm even neglecting og_blueprints (despite it being my beloved baby); I would have fixed this bug, however, I built a fair bit of the help architecture around it, and just haven't had a chance to re-architect it in a way that doesn't require array_intersect_keys().

If someone were to post a patch, however, I'd be happy to consider patching it in, at least for the short term. I'd accept either a patch that implements a working substitute for array_intersect_key() for those who don't have it, or a patch that (preferably) re-architects the logic behind the help system in a way that obviates the need for the call in the first place. Really, the preferable route would be to implement an abstract factory class system, which is the route I'll go eventually, but I'd take any patch that doesn't make my eventually going that route harder.

jackspiv’s picture

Thanks for the clarity and straightforward reply. If I were a coder I would gladly help out.

sdboyer’s picture

Status: Active » Closed (won't fix)

So, on further reflection - unfortunately, I'll be heading in the direction of using SPL functions and other things that require 5.1, and prefer 5.2, so I won't be re-architecting this change. Sorry :(