Opened 5 years ago

Closed 5 years ago

#1485161 closed Bugs (fixed)

Disabled add-buttons in addressbook

Reported by: nilu Owned by:
Priority: 5 Milestone: 0.2-beta
Component: PHP backend Version: git-master
Severity: normal Keywords: Revision: 1574
Cc:

Description

I cannot add and delete contacts in my addressbook because the add- and delete-buttons are disabled.
But adding a contact by clicking "+" next to an e-mail-address in an email works.


Investigation:

I have

$rcmail_config['ldap_public'] = false;

in my config/main.inc.php.

In steps/addressbook/func.inc line 56 the foreach-statement sets the address-source to readonly because:

(array)$CONFIG['ldap_public'] 


is converted to an array with on element:

echo var_dump((array)$CONFIG['ldap_public']);

array(1) { [0]=> bool(false) }


Possible Fix:

Add an additional check (steps/addressbook/func.inc Line 56):

if($CONFIG['ldap_public'] != false){
  foreach ((array)$CONFIG['ldap_public'] as $id => $prop)


Attached an "svn diff"

Change History (2)

comment:1 Changed 5 years ago by nilu

Attaching files is not working, the diff:

Index: program/steps/addressbook/func.inc
===================================================================
--- program/steps/addressbook/func.inc  (Revision 1574)
+++ program/steps/addressbook/func.inc  (Arbeitskopie)
@@ -53,8 +53,10 @@
   // We are using the DB address book, add it.
   $js_list = array("0" => array('id' => 0, 'readonly' => false));
 } // end if
-foreach ((array)$CONFIG['ldap_public'] as $id => $prop)
-  $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writable']);
+if($CONFIG['ldap_public'] != false){
+  foreach ((array)$CONFIG['ldap_public'] as $id => $prop)
+    $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writable']);
+}
 $OUTPUT->set_env('address_sources', $js_list);

comment:2 Changed 5 years ago by alec

  • Milestone changed from later to 0.2-beta
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [3dc20a0d].

Note: See TracTickets for help on using tickets.