Hack with a long tail [parent activeselect, category moved to other container, code clean-up]
| Project: | Category |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Part 1: Creation
Sun Mar 5 03:03:28 2006 UTC
category.module, revision 1.69
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/category/cate...
"Parent select box now gets all possible options on submit, to prevent activeselect validation errors."
Part 2: Lost in Translation
Sat May 13 14:28:36 2006 UTC
category.module, revision 110
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/category/cate...
(really long log message mentioning refactoring)
<?php
// This makes the parent element have all possible options on submit,
// to prevent validation errors with activeselect.
if ((!isset($op) || !empty($errors)) && $node->cnid) {
$default_parent = $node->cnid;
}
?>category.inc, revision 1.48
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/category/cate...
(really long log message mentioning refactoring)
<?php
// This makes the parent element have all possible options on submit,
// to prevent validation errors with activeselect.
if ($node->cnid && $is_cat) {
$default_parent = $node->cnid;
}
?>Part 3: The Bug Report
May 19, 2006
Moving Category to a different parent container causes problems.
http://drupal.org/node/64551
Part 4: The Workaround
Tue Jun 6 14:09:45 2006 UTC
category.inc, revision 1.54
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/category/cate...
"- #64551: moving category to a different container causes problems."
<?php
// This makes the parent element have all possible options on submit,
// to prevent validation errors with activeselect.
if (!$activeselect && $is_cat) {
$default_parent = $node->cnid;
}
?>Part 5: Analysis
The hack originally put in to fix activeselect broke activeselect and is disabled when using activeselect.
If this code is really needed for the non-activeselect case, the comment should be changed to be a little more accurate, yes? ;-)

#1
Adding some info to issue title, I clicked this multiple times already while searching for unrealted stuff...
Also setting a version, guessed from above post date, since HEAD is something completely different today.
I didn't check any version of code yet (neither from 2006, nor recent 6.x), only just cleaning in the queue for now.