Active
Project:
Content Profile
Version:
6.x-1.0
Component:
User registration module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2010 at 16:27 UTC
Updated:
28 Mar 2011 at 09:12 UTC
As reported in this discussion (HS on registration form does not save values) there is a compatiblity issue between Content Profile and Hierarchical Select modules. In order to fix this, there is a code that should go into the content_profile_registration.module, in the content_profile_registration_user_register_submit function just before the "Create the node" and node_submit($node) lines.
The code is:
if (module_exists("hierarchical_select")){
$query = "SELECT distinct field_name, multiple FROM {content_node_field_instance}
INNER JOIN {content_node_field} USING (field_name)
WHERE type_name = '{$type}' AND widget_type LIKE '%_hs'";
$db_result = db_query($query);
//We look for all fields
while ($item = db_fetch_array($db_result)) {
$field_name = $item['field_name'];
$val = array();
$field_table = $node->$field_name;
if (isset($field_table['tids'])){
foreach ($field_table['tids'] as $key => $value) {
$val[] = array('value' => $value);
}
}
if (isset($field_table['nid'])){
foreach ($field_table['nid'] as $key => $value) {
$val[] = array('nid' => $value);
}
}
if (!empty($val)){
$node->$field_name = $val;
}
}
What is the right way to solve the problem?
Add this code to the next Content Profile release?
Comments
Comment #1
thadwheeler commentedI have the same sort of issue and I am not using this component of the Content Profile.
Comment #2
thadwheeler commentedHas there been any movement on this?
Comment #3
Balbo commentedI did get no feedback on this :-/