Battle plan for multiple node types

Node types

Since extra fields are per-node-type, this implies replacing the extra
fields by a proper field

Ad lists can therefore no longer be built by node type.

Take advantage of the change to replace custom lists by default Views

Enabled node types can either be defined by module settings, or (better ?)
automatically be identified by the presence of an instance of the
expiration field

Extra fields to Field

The module defines two form extra fields, expires_fs on forms
and expires for display

Kill both extra fields

Add a new Field replacing both, this means:

Done. Field is now available on Field UI only for node entities. Adding field info/CRUD hooks

Hooks implemented. Actual logic to be done. Adding a new widget to replace the form logic for expires_fs

Hooks implemented. Actual logic to be done. Adding a new formatter to replace the node view logic for expires

Custom lists to Views

The module has inner knowledge of the specifics of the expiration extra
fields.

Lists are built either using custom built lists including it, or using
the new custom view mode introduced in 7.3. With multiple node types, this
is no longer doable so we replace these lists by taxonomy-filtered views.

With the extra field gone, its Views field handler no longer works.

Replace the expiration field handler

Replace the home page list with a view. Keep the various counters.

Replace the per-term list with a view. Keep the various counters,
sub-category links, and breadcrumbs generation. This is likely to
involve attached views and/or new specific handlers.

Replace the per-user profile list with a view. Handle the empty case.

Replace the per-user rendered and raw token with two displays of a view.

Replace the per-user link token, possibly still by manual code.

Configuration

Simplify configuration: reduce the number of variables by grouping lifetimes in a single variable

Custom logic

Most of the module complexity lies in the expiration handling: automatic
expires generation and update. This needs to be adapted for the additional
complexity of a field over an extra field. Existing node form hooks and
handlers must be replaced by field hooks since we no longer know which forms
to intercept.

i18n

A number of users have expressed frustration at the lack of i18n support
in the module. Switching the extra fields to a field and the custom lists
to Views will help with this. New code should be i18n-compatible, so that
later changes can bring full i18n compliance

Testing

The code currently has 100% S0 test coverage. This should not go down, but
increase towards 100% C0.

Rewrite tests to match the new code structures

Add tests for each new function/method introduced

Drupal 8

Any significant work should take into account the directions taken by D8.
The move from an extra field to a normal field is in the right direction. Other significant
changes regard code placement outside the module file and the use of
autoloaded namespaced classes, one per file.

Strip all non-hook code from the module file and move it to class
methods

Extract all logic from hook implementations to class (static) methods, leaving only the "glue" bits in the hook implementation, to ease unit testing.

Action code externalized in so doing should be considered for being made
usable at the admin level by exposing it as a core action, typically for
the user or node entities

Done: converted to classloader. Consider using xautoload or classloader
to apply PSR-0, or declare classes the D7 way, manually in the info file.

submit handler does validation job on expiration reset: moved to validation handler instead

classified node links:

HL add link to ad author page: redundant with author info on node

HL add link to contact: titled as a way to suggest new categories, duplicates the normal contact link

HLA replace taxonomy/term/<tid> links with ed_classified/<tid> when <tid> belongs in the module vocabulary, in order to have a specific page take over instead of the default taxonomy term page for these. Done with hook_term_path() instead, for more generality.