Topic: small bug item units db

the function get_unit_descr($unit) on line no 44 defined in inventory/includes/db/item_units_db.inc file

instead of name you are selecting description column which does not exist in db

function get_unit_descr($unit)
{
    $sql = "SELECT description FROM ".TB_PREF."item_units WHERE abbr=".db_escape($unit);
    $result = db_query($sql, "could not unit description");
    $row = db_fetch_row($result);
    return $row[0];
}

change to

function get_unit_descr($unit)
{
    $sql = "SELECT name FROM ".TB_PREF."item_units WHERE abbr=".db_escape($unit);
    $result = db_query($sql, "could not retrieve unit name");
    $row = db_fetch_row($result);
    return $row[0];
}
ANOOP
Experience is the name everyone gives to their mistakes!

Re: small bug item units db

@anoopmb: good catch. Needs to be corrected in FA 2.3 as well. Where did you have to use this function?

Whether a new field is necessary and whether the function name should be changed accordingly needs to be ascertained.

Note that this function is not used in FA 2.3.26 and in FA 2.4.6 as well and see if it needs to be removed. Neither is it used in any official theme / extension and those in my FA24extensions repo.

@joe: can commit it.

Re: small bug item units db

This has been fixed and committed. Thanks @anoopmb.

We will see later if the function is needed or not.

/Joe