Posted by spficklin on November 5, 2010 at 1:06am
1 follower
| Project: | E-Journal |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
If another module updates a node using the nodeapi and uses the node_save function, the article will lose the journal issue to which it was assigned. It seems to be caused by the fact that on update the module expects to find a $node->nid_issue variable set. However, when using node_save this variable doesn't exist (it's a form variable I believe) and the issue to which the article belongs gets wiped out.
I temporarily fixed the problem with the following code added at line 2614:
2614 // if $node->nid_issue is not defined then we are here through a means
2615 // other than the editin the node directly through the node form (i.e. a node save is
2616 // performed elsewhere), in which case we need to set this value equal to the
2617 // current issue id or it will be blanked out
2618 if(!isset($node->nid_issue)){
2619 $node->nid_issue = $article->iid;
2620 }