6.0.0-beta1
7/11/25

[#9164] PHP 5 + Turba + Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/html/horde/turba/config/sources.php on line 123
Summary PHP 5 + Turba + Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/html/horde/turba/config/sources.php on line 123
Queue Turba
Queue Version 2.3.4
Type Bug
State Resolved
Priority 2. Medium
Owners mrubinsk (at) horde (dot) org
Requester ccto (at) website-solution (dot) net
Created 08/03/2010 (5456 days ago)
Due
Updated 09/13/2010 (5415 days ago)
Assigned
Resolved 08/03/2010 (5456 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/03/2010 03:31:30 PM Michael Rubinsky Comment #3
Assigned to Michael Rubinsky
State ⇒ Resolved
Reply to this comment
Fixed in CVS - not relevant for Git.
08/03/2010 03:30:24 PM CVS Commit Comment #2 Reply to this comment
Changes have been made in CVS for this ticket:

Make sure all needed configuration is present when calling 
listTimeObjectCategories.
Fixes Bug #9164
http://cvs.horde.org/diff.php/turba/lib/api.php?rt=horde&r1=1.120.2.70&r2=1.120.2.71&ty=u
08/03/2010 08:07:18 AM ccto (at) website-solution (dot) net Comment #1
Priority ⇒ 2. Medium
Patch ⇒ No
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ PHP 5 + Turba + Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/html/horde/turba/config/sources.php on line 123
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
Hello Horde/Turba Team.

Under PHP 5 (5.2.14) environment, when users (or admin) login , it 
will raise the following message -

Warning: array_merge() [function.array-merge]: Argument #1 is not an 
array in /var/www/html/horde/turba/config/sources.php on line 123

However, in PHP 4 (4.4.9) environment , it does not raise the above message.

--------

We found that under ./turba/lib/api.php , the function 
_turba_listTimeObjectCategories()
function _turba_listTimeObjectCategories()
{
     include dirname(__FILE__) . '/../config/attributes.php';
     $categories = array();
     include dirname(__FILE__) . '/../config/sources.php';
     foreach ($attributes as $key => $attribute) {
         if ($attribute['type'] == 'monthdayyear' &&
             !empty($attribute['time_object_label'])) {

             foreach ($cfgSources as $source) {
                 if (!empty($source['map'][$key])) {
                     $categories[$key] = $attribute['time_object_label'];
                     break;
                 }
             }
         }
     }



     return $categories;
}

when calling to sources.php to get the map, the $conf[ 'sql' ] array 
SHOULD already be unset and cause the empty/NULL array to be merged 
warning message under PHP 5.

Please help.

Thank you for your kind attention.
Regards
Geogre

Saved Queries