warning: array_search() [function.array-search]: Wrong datatype [Line 950]
jadedknight - August 14, 2007 - 15:33
| Project: | Membership types and registration modification |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
warning: array_search() [function.array-search]: Wrong datatype for second argument in /*path_to_website*/modules/nf_registration_mod/nf_registration_mod.module on line 950.
This error appears everytime a user logs in...
Does anyone know how to solve this issue?

#1
The error implies that the second argument is not an array. This would be the case only if _nf_registration_mod_get_pageroute_pages() returns and no pageroute pages were found. I assume you are using nodeprofile content types and pageroutes per the README, aren't you?
Could you let me know what your system specs are (PHP, MySQL, Apache, etc.)?
Also, try changing the function below to read as I show here. All I added was the part that reads $pagepages = array(). This will ensure that at least an empty array is returned and the error you found should not fire. Nevertheless, it should not be returning empty. Something must not be setup correctly.
function _nf_registration_mod_get_pageroute_pages() {$pagepages = array();
$sql = "SELECT prid, name, options FROM {pageroute_pages} ORDER BY weight, name";
$results = db_query($sql);
while ($result = db_fetch_object($results)) {
$type = unserialize($result->options);
$type = $type['content-type'];
$pagepages[$result->prid][$result->name] = $type;
}
return $pagepages;
} // function _nf_registration_mod_get_pageroute_pages()
#2
Related to this: http://drupal.org/node/157997, so technically a duplicate.
I think I've made sure that all functions that should return an array at least return an empty one.
Let me know if I missed something.
#3