This patch introduces a single function set to read and write mailboxes in database. Currently read/write operations are being done here and there in the module, sometimes as array, others as object.

The functions just mimic the way Drupal 6 and Drupal 7 works with 'entities', however I don't have the plan to convert mailboxes into entities for the D7 version. This functions will make eassier the code review and understanding for anyone used to see _load and _save functions.

There is also a mailbox_defaults function that return an empty mailbox with default values. Currently the default values are the same as the ones used in the adminsitration form, but there is a single change: the format. The module has never used the value FILTER_FORMAT_DEFAULT, because the 'format' form element always selected any of the available formats. For this reason I've changed this constant wit the Drupal site's variable 'filter_default_format' that contains the default format selected by an administrator. (Note that in Drupal 7, format is no longer required by core, and the value of filter is per-field).

This patch introduces the function, but they are only used when manually retrieving the content of a mailbox, because hook_menu, hook_cron, and the administration forms require another patch to make use of them.

Comments

ilo’s picture

StatusFileSize
new6.18 KB

rolling againt against 6.x-1.x-dev, patch does not apply with current changes.

cor3huis’s picture

Status: Needs review » Reviewed & tested by the community

Cannot perform a live test at my dev machine at the moment (Need to get this damn SuperCron module to work first), but reading through your new code, elegance shines from the code. As far as I can see good implementation.

ilo’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -#D7

wow, such a nice 'unexpected' comment :)

Thanks for taking a look Cor3huis, committed as: http://drupal.org/cvs?commit=489912

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.