I have installed version 5.x-1.0-beta1 with all modules request, on Drupal 5.1 with Apache/2.2.3 (Win32) PHP/5.2.0 and database MySQL 5.0.27, and I have this 2 warnings. What I must do? I'm not a programmer so please help me.
Thxs Matteo
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\Programmi\EasyPHP 2.0b1\www\drupal\sites\all\modules\dbfm\dbfm.module on line 1210
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\Programmi\EasyPHP 2.0b1\www\drupal\sites\all\modules\dbfm\dbfm.module on line 2238
Comments
Comment #1
matteo82 commentedok i have resolved....
these are the 2 lines:
if ($updateresult = dbfm_dbupdate_file($form_values['fid'], $path = FALSE, &$err_arr, $metadata) ==1 ) {
$ret = dbfm_recur_dbrename($rootrec, &$ret, $err_arr);
I removed the ampersand:
if ($updateresult = dbfm_dbupdate_file($form_values['fid'], $path = FALSE, $err_arr, $metadata) ==1 ) {
$ret = dbfm_recur_dbrename($rootrec, $ret, $err_arr);
Comment #2
rooey commentedDon't use the Beta.
The official release was made some time ago:
http://drupal.org/node/200591
Comment #3
rooey commentedComment #4
Dewi Morgan commentedThis bug is still present in 5.x.2.2, and even in the dev version.
The only place where you are permitted to have &$varname is in a function declaration.
As a compile-time warning, this message is not logged to the Drupal watchdog list, so you may be missing it.
When developing modules, please use a recent version of PHP and turn on logging of full PHP warnings in php.ini.
That means:
error_reporting = E_ALL | E_STRICT
All the following lines need the "&$"s changed to "$".
$ wget http://ftp.drupal.org/files/projects/dbfm-5.x-2.x-dev.tar.gz
$ tar xzvf dbfm-5.x-2.2.tar.gz
$ grep -IR '&\$' * | grep -vP ': *(function|\*)'
dbfm/dbfm_file.inc: $fred = dbfm_delete_recur($rec_to_delete, &$ret, &$err_array);
dbfm/dbfm_file.inc: $ret = dbfm_delete_recur($sdata, &$ret, &$err_arr);
dbfm/dbfm_properties.inc: if ($updateresult = dbfm_dbupdate_file($form_values['fid'], &$err_arr, $metadata) == TRUE ) {
dbfm/dbfm_properties.inc: dbfm_recur_dbrename($new_rec, $ret, &$err_arr);
dbfm/dbfm.module: $ret = dbfm_delete($frec, &$err_arr);
dbfm/dbfm.module: $perm_res = dbfm_perm_recur($frec, &$err_str);
dbfm/dbfm.module: $ret = dbfm_move($src_rec, $dest_rec, &$err_arr);
dbfm/dbfm.module: $dirlist = new dbfm_build_dir_list($frec->fid, '', &$err);
dbfm/dbfm.module: if (dbfm_dbupdate_file($dup_rec->fid, &$err, $metadata) == FALSE) {
dbfm/dbfm.module: if ($file_in_db = dbfm_dbinsert_file($parent_rec, &$err, $metadata)) {
dbfm/dbfm.module: $ret_val = dbfm_perm_recur($fkid, &$err_str);
dbfm/dbfm.module: $ret = dbfm_recur_dbrename($rootrec, $ret, &$err_arr);
Then the following lines:
dbfm/dbfm_file.inc:function dbfm_delete($rec_to_delete, $err_arr) {
dbfm/dbfm_file.inc:function dbfm_delete_recur($source, $ret, $err_arr) {
dbfm/dbfm_file.inc:function dbfm_move($source_rec, $dest_rec, $err_arr) {
dbfm/dbfm.module: function dbfm_build_dir_list($fid = '', $path = '', $err) {
dbfm/dbfm.module:function dbfm_dbupdate_file($fid, $err_arr, $metadata = array()) {
need changing as follows:
dbfm/dbfm_file.inc:function dbfm_delete($rec_to_delete, &$err_arr) {
dbfm/dbfm_file.inc:function dbfm_delete_recur($source, &$ret, &$err_arr) {
dbfm/dbfm_file.inc:function dbfm_move($source_rec, $dest_rec, &$err_arr) {
dbfm/dbfm.module: function dbfm_build_dir_list($fid = '', $path = '', &$err) {
dbfm/dbfm.module:function dbfm_dbupdate_file($fid, &$err_arr, $metadata = array()) {
This should resolve these errors.
Comment #5
Dewi Morgan commentedAlso, obviously, if you want to catch this error, make sure you haven't set allow_call_time_pass_reference to true in your INI file.
Comment #6
geoff_eagles commentedA big thanks for spotting the errors. I've had to change the error reporting - I'd never provided for reporting multiple errors in the javascript so having an error array never actually worked properly. I've now just used an error string everywhere. And this time the ampersands ONLY go in the function declarations (kinda rushed coding the first time around and I slipped up a few times). The first of the 'replication' releases is currently being tested and should be out within the next few days - this fixes the errors. Then I'll be starting on a proper search facility.
Comment #7
rooey commentedComment #8
rooey commented