Hi guys

Congratulations on your release of OpenPublic. The installation went well apart from the following warning message:

Warning: Parameter 1 to defaultcontent_node_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (line 334 of /Applications/MAMP/htdocs/openpublicdemo/includes/entity.inc).

Comments

bfroehle’s picture

Yes, I got that too on an installation in MAMP.

bfroehle’s picture

Project: OpenPublic » Default Content (Deprecated)
Version: » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new803 bytes

Attached patch changes the function signature to

function defaultcontent_node_load($nodes, $types) {

as in hook_node_load().

Dutchy71’s picture

Hi bfroehle, yes this occurred in MAMP. Thanks for the patch. Now my next question is how do I apply the patch?

Dutchy71’s picture

I've found the instructions on patching. Thanks.

jamsilver’s picture

StatusFileSize
new407 bytes

Just rerolling that patch without the prefixes.

  git diff --no-prefix

Is very useful.

bfroehle’s picture

@jamsilver: Thanks, but it's not necessary. Since the great git migration, the standard is patch level 1 (which is what is created by just running git diff). (Before the great git migration, your suggested approach was correct).

WebmasterDrake’s picture

And if we aren't using git, how do we install the patch?

WebmasterDrake’s picture

For those looking for the file to modify, it is located here:

profiles/openpublic/modules/contrib/defaultcontent/defaultcontent.module

At or about line 12 find:

function defaultcontent_node_load(&$nodes, $types) {

And REPLACE with:

function defaultcontent_node_load($nodes, $types) {

jamsilver’s picture

@bfroehle. At the time I was rerolling it mainly for my own benefit so I could put it directly into a drush make file - which at the time I believe can only handle -p0. I didn't know that patch level 1 was standard now - thanks for the tip. =p

bfroehle’s picture

@jamsilver: Good to know. I haven't used drush make yet but it's on my todo list. ;)

e2thex’s picture

Status: Needs review » Fixed

Thanks for the catch and the patch, committed
commit 3d2a1ffb7f40cb83b526839aa980c20328e55016
Date: Tue Mar 22 11:02:43 2011 -0400
Issue #1087244 by bfroehle: DrupalDefaultEntityController warning

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

metakel’s picture

I have just realized that when I use "xxx-xx", the theme does not show up.
It only work when I changed the hyphen to underscore, i.e. "xxx_xx"