Issue management form: unchangable sections
| Project: | E-Journal |
| Version: | 5.x-2.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
After assigning a flat vocabulary to a journal and creating a few test nodes under the vocabulary terms, I noticed a bug in the issue management form as I tried to change an article's section with no success. I experimented with different articles and many taxonomy terms; however, the section always remains the same.
Some debugging revealed the mishandling in the issue management form. When the form is submitted the selected sections (terms) are added to the term_node table instead of replacing existing ones. This is caused by the empty old_tid form element that is supposed to hold the old section value for comparison later in the process. More and debugging lead to the root of the problem which turned out to be the ejournal_sections_of_article() function. In that function the $vids array at lines 3085 and 3086 skips a key-based array that is the actual parent of the vocabulary terms array. The key-based array holds what appears to be the vocabulary's multiplicity setting.
So instead of:
<?php
if (isset($vids[$tid])) { ...
$return[$tid] = $vids[$tid];
?>Somthing like the following could work:
<?php
if (isset($vids['single-choice'][$tid])) { ...
$return[$tid] = $vids['single-choice'][$tid];
?>
#1
Hi baddlan,
excellent! Ejournal has never received such a good bug report, a fix actually.
It is fixed in the development version (5.0), will you please try it?
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/ejournal/?p...
<?phpif (isset($vids['single-choice'][$tid])) {
$return[$tid] = $vids['single-choice'][$tid];
}
else if (isset($vids['multi-choice'][$tid])){
$return[$tid] = $vids['multi-choice'][$tid];
}
?>
Best,
#2
#3
Automatically closed -- issue fixed for two weeks with no activity.
#4
Romca -
This issue has reappeared (never fixed?) in 5.x-2.x-dev dated 2008-Dec-21.
Using a multi-level hierarchy, with no related terms, multi-select enabled as the sections taxonomy. Term A was set for a node, then the issue management panel to change the section to Term B. Issue management panel showed the change to Term B, but the issue list of articles showed the node still in the Term A section. Edited the node and found both Term A and Term B were selected.
Changing the taxonomy to a single select vocabulary makes the issue management panel work as expected.
Or is this by design, to only allow one node to be in one section of the Journal?
#5