The ingredients are stored in the database with small caps (which I think complies with mealmaster format) but I need to display them with capitalized caps (eg, not "sugar" or "salt" but "Sugar" or "Salt").
I don't know whether it was intended from the author to have them small caps or if my drupal installation cause this (I got the wiki extension with freelinking and pathauto).
Maybe there is a way to change function recipe_load_ingredients($node) to just get a capitalized output with ucfirst or ucword($ingredient).

Comments

Paike’s picture

Ok, I just removed the strtolower from the _in_array() (line ~771), and it works, the ingredients will be stored in the db "casesensitivly". But because I dont really understand the meaning of this function this could have sideeffects?

function _in_array($a, $b) {
  $a->name = trim($a->name); // trim(strtolower($a->name))
  foreach($b as $row) {
    $compareto="";
    if (is_array($row)) {
      $compareto = trim($row["name"]); // trim(strtolower($row["name"]))
    } else {
      $compareto = trim($row->name); // trim(strtolower($row->name))
    }
    if ($a->name === $compareto)
      return true;
  }
  return false;
}

PS: the bug appeared also in a clean installation of drupal with no other modules.

drawk’s picture

Status: Active » Closed (works as designed)

I'm changing the status from to "by design". Conventionally, recipes are in a format with lowercase ingredients except when a proper noun is used. IE - "2 tsp sugar" or "2 tsp Splenda sugar substitute".

Paike’s picture

Mh, it's not the same convention in german (and maybe in other languages?) so at least for german users we would need capitalized letters. I looked at some other german recipe sites, sometimes you need to have small and capitalized caps for one ingredients entry. And as you wrote, there could sometimes be the case that a proper noun is used :)

The question is, are the lowercase ingredients needed for other code purposes?