* 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:45 +00:00
parent 5b2b8ea37d
commit 6df01e13de

View File

@ -348,7 +348,10 @@ class customfields
// search free type character // search free type character
for($i=97;$i<=122;$i++) 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); $new_type = chr($i);
break; break;