If you did do this, it might make senes to simply have it as a
configurable option in the PreApproved rather than as a whole separate
plugin. You might consider submitting a patch.
--
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog
That's an excellent question. I've CC'd this to the developers list.
There's a comment in the code that asks if we should be unregistering
the 'PreApproved' type. I haven't looked into the implications of
unregistering a type (yet); perhaps someone can now say if it's a bad
idea? The evidence above suggests it may be ...
I don't like the idea of unregistering log types when the plugin that
provides that log type is deactivated. It means that there could be
logs stored in the DB for which no log type is defined.
For the record, I also dislike the idea of removing statuses and
content type indicators when plugins that create them are deactivated.
Can someone provide a compelling argument for why it would be
beneficial to remove a log type, status type, or content type record
when the associated plugin is disabled?
Just to follow up here, the consequence to unregistering a log type is
that any log entries that reference that type get marked as
"Unknown". As such, I would think it is not desirable to remove the
log type when there still exist entries in the log associated with
that type.
As for adding log types, apparently they are added automatically when
writing to the log (by LogEntry::type() called by
LogEntry::insert()). So does one even need to register a log type
when activating a plugin?
BTW, the reason the PreApproved plugin was causing an internal server
error is because it passed only one argument to the two-argument
function register_type, which has the second argument ('module') set
to null by default, but the schema of the log_types table disallows
nulls for 'module' or 'type'.
- Braden