Hi

After installing the module I get the following error

Deprecated function: Call-time pass-by-reference has been deprecated in require_once() (line 26 of /*** /all/modules/family/family.module).

My coding is a little off but when I opened family.module on line 26 it said
require_once("{$fampath}/import.inc");

which to me seems ok ???

any ideas??

Thanx,
Brett

Comments

old_dog’s picture

This happens under PHP 5.3.
The cause for the complaint is in "import.inc" where it calls node_validate()
see http://drupal.org/node/1330772

This is just the beginning of the problems you will encounter.

Vietyank’s picture

Is anyone going to work on this or has it been fixed in the dev release?

Zarevac’s picture

Assigned: Unassigned » Zarevac
Status: Active » Closed (fixed)

Fixed in new release

stewarttate’s picture

Status: Closed (fixed) » Needs work

Issue remains in family 7.x-1.0 on Drupal 7.14

Deprecated function: Call-time pass-by-reference has been deprecated in require_once() (line 26 of *\sites\all\modules\family\family.module)

Zarevac’s picture

Most likely you are not consistent in your GEDCOM file with dates. Also, upgrade to the latest D7 ;-)

lipinponmala007’s picture

i got a fix from #1 thanks #1

i opened import.inc
changed to

node_validate($node, $form, &$form_state);
//no need to pass by reference now
node_validate($node, $form, $form_state);

i found two of them one in line 209,296

my version info

D7.17,family 7x-1.0

eriji’s picture

D7.21 ; Family Tree 7.x-1.0

Deprecated function: Call-time pass-by-reference has been deprecated in require_once() (line 26 of /home/e****/o*****.info/sites/all/modules/family/family.module).

Am receiving this error (line 26 of...) after initial install/enable. Do not have any data yet to cause data problems. (Also it's a new site so it doesn't have any old data either.)

Will investigate some of the other notes/possible solutions above and report back in a few days.

old_dog’s picture

Try searching for "Deprecated function: Call-time pass-by-reference has been deprecated in require_once()" here on drupal.org for plenty of discussion.
Apparently, PHP reads the referenced file, finds the pass-by-reference, then curiously flags the require_once statement with the warning rather than the actual offending instance.

eriji’s picture

@old_dog Thanks for the CLUE to where to find the problem. I did get it fixed, and I guess learned something in the process.

Posted by old_dog on November 25, 2011 at 11:41pm
I think these warnings start appearing with PHP version 5.3.x
From what I've read, all arguments are passed by reference since some earlier version of PHP 5, meaning that using the "&" is not required. The newer PHP versions get annoyed when they are used.

The fix is to remove the "&" in front of any occurrence of "$form_state".

And that means every occurrence of "&$form_state" in all of a number of files in the "family" module directory.

I think there are about 5 or 6 different files with 2-3 occurrences in each file.

There may be something else to this but couldn't the developer correct the code for just this problem and re-issue the module??? You can even have the code after I made the corrections.

old_dog’s picture

And that means every occurrence of "&$form_state" in all of a number of files in the "family" module directory.

I think there are about 5 of 6 different files with 2-3 occurrences in each file.

NO NO

I was unclear in that post -- only in the import.inc file. There are 2 occurrences.
Also, at the time, I knew less than I do now (still not much). The & is required in different situations.

couldn't the developer correct the code for just this problem and re-issue the module???

Good Luck with that!

lipinponmala007’s picture

My problem solved....

try remove '&' in the following lines in the import.inc file.

node_validate($node, $form, &$form_state);
node_validate($node, $form, &$form_state);
family_import_submit($form, &$form_state)
old_dog’s picture

Actually, you can remove entirely the two lines calling node_validate(). They don't seem to serve any purpose in this routine. These 2 lines are commented out in Zarevac's latest zip files.

Don't remove the & in the line family_import_submit($form, &$form_state)
This is required to access the $form_state['values'] data from the import form.

old_dog’s picture

Status: Needs work » Active