Active
Project:
Conference
Version:
6.x-1.2-beta2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2010 at 14:09 UTC
Updated:
17 Sep 2013 at 09:47 UTC
Hi I am usng the Conference module on a website. And after creation of several papers I found out a lot of duplicated papers IDs.
I've looked a little into the module's code and I think the problem is here:
function conference_nodeapi(&$node, $op) {
switch ($op) {
case 'prepare':
//NOTE: I think this could be a problem when there are simultaneous submissions
//Need to check it out
$ctype_paper = variable_get('conference_ctype_paper', 0);
if ($ctype_paper == $node->type) {
$paper_id_prefix = variable_get ('conference_default_paperid_prefix', '');
if (!$node->field_paper_id) {
$current_max_num = 0;
$current_max_id = db_result (db_query ("SELECT (field_paper_id_value) FROM {content_type_conference_paper} ORDER BY field_paper_id_val\
ue DESC LIMIT 1"));
if ($current_max_id == NULL) {
//since there are no new papers just set up the prefix
$current_max_id = $paper_id_prefix;
}
else {
//Get the max number and then add one and create a new paper
$current_max_num = split ($paper_id_prefix, $current_max_id);
$current_max_num[1] = intval ($current_max_num[1]) + 1;
}
$node->field_paper_id[0]['value'] = $paper_id_prefix.sprintf ("%04d",$current_max_num[1]);
}
}
break;
The check against existing paper ids is done on node prepare. So if more than one person start to create a new paper node, the field used to store paper ID is populated with the same number.
I think that the check should be done on 'insert'.
Comments
Comment #1
BasMichielsen commentedA very annoying bug indeed and your suggestion is correct. I discovered this too late and I am now forced to use the 'nid to identify the contributions. (If I use administrator permissions to edit the paper ID, I seem to be leaving the node access in a state which makes it unaccessible for the user who created it. That is probably not a conference module problem, though.)
Comment #2
nedavh commentedi have the same problem
what should i do
its too important for me
please hepl me
Comment #3
nedavh commentedhellooooooooooooooooooo
i need help
plz answer this question