diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index bccad47e2d8..c53117a6821 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -652,7 +652,7 @@ foreach ($accounts as $key => $type) {
print ''.$langs->trans("ConciliationDisabled").'';
} else {
$result = $objecttmp->load_board($user, $objecttmp->id);
- if ($result < 0) {
+ if (is_numeric($result) && $result < 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
} else {
print '';
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index f1cf8e43269..b5f8ced66a0 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -438,7 +438,11 @@ function societe_prepare_head2($object)
*/
function societe_admin_prepare_head()
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('societe');
+ $extrafields->fetch_name_optionals_label('socpeople');
$h = 0;
$head = array();
@@ -456,11 +460,19 @@ function societe_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
+ $nbExtrafields = $extrafields->attributes['societe']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsContacts");
+ $nbExtrafields = $extrafields->attributes['socpeople']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes_contacts';
$h++;
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index 67d41199594..267ca6803c9 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -23,7 +23,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
$tmpkey = 'options_'.$key;
- if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) {
+ if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && isset($obj->$tmpkey) && !is_numeric($obj->$tmpkey)) {
$datenotinstring = $obj->$tmpkey;
if (!is_numeric($obj->$tmpkey)) { // For backward compatibility
$datenotinstring = $db->jdate($datenotinstring);