I've tried to add new units in units.xml.
I've cleared the cache in order this change show up.
I've seen the new units, but i was unable to save my selection of units in the units configuration page.
I've seen this error message.

warning: unserialize() [function.unserialize]: Node no longer exists in /pathToDrupal/includes/cache.inc on line 33.
How can I solve this problem?
How to add easily new units?

Comments

raspberryman’s picture

Status: Needs review » Closed (works as designed)

The best way is to invoke hook_unitsapi(), and add your units via your own module.

/**
* Implementation of hook_unitsapi().
*/
function mymodule_unitsapi() {
  $data['meter']['singular'] = 'metre';
  return $data;
}

Please let me know if this hook isn't working out for you.