zikula-modules/Legal — Issue #18: Legal Notice doc type cannot be disabled
Author: rmburkhead
Created: 2011-12-29 07:25:42+00:00
State: open
Labels: Bug, Major

The document type 'legalnotice' cannot be disabled from the admin panel settings page. When this type was added, the control used on the form was a check box. When a check box is cleared (no check mark) and submitted the control is not "successful" according to the HTML specification, and therefore no variable is added to the `$_POST` variable for that control. Since no variable is set on the post, `updateConfig()`'s call to `request->getPost()->get()` will use its default, but the default was set to `true` when the code was added.

The implication of the code is that the developer expected to be returned a post variable with a value of 0 if the type was to be disabled. As described above, check boxes do not operate this way. Setting `true` as the default installation active state for the type in the installer is fine, but if check boxes are to be used on the settings page, then the default for the `get()` call must be false.