* Addressbook: skip letter of deleted type, when creating new contact types, as it gives SQL error

This commit is contained in:
Ralf Becker 2012-05-08 08:50:19 +00:00
parent dd913e89ab
commit 06729148dd

View File

@ -348,7 +348,10 @@ class customfields
// search free type character
for($i=97;$i<=122;$i++)
{
if(!$this->content_types[chr($i)])
if (!$this->content_types[chr($i)] &&
// skip letter of deleted type for addressbook content-types, as it gives SQL error
// content-type are lowercase, addressbook_so::DELETED_TYPE === 'D', but DB is case-insensitive
($this->appname !== 'addressbook' || chr($i) !== strtolower(addressbook_so::DELETED_TYPE)))
{
$new_type = chr($i);
break;