2 blueyed Nov 01, 2007 04:25

I've changed the fix, and added the check to the code which calls set_filters(); see http://evocms.cvs.sourceforge.net/evocms/b2evolution/blogs/inc/items/model/_itemlistlight.class.php?r1=1.10&r2=1.11
Thanks to Afwas for testing/debugging.
I just downloaded latest CVS and receive the same error in the backoffice post list:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /blogs/inc/items/model/_item.class.php on line 1820
That's another one, isn't it?
Just add "echo debug_get_backtrace();" there and then you'll see where it comes from, e.g.:
if( ! is_array( $whatever_is_argument_2_here ) )
{
echo debug_get_backtrace();
}
Backtrace:
1. Item->get_edit_link( " ", " ", "<img src="http://www.blog.hemminga.net/rsc/icons/edit.gif" borde...", "#", "" )
File: /home/hemmi3/public_html/blog/inc/items/views/_item_list_table.view.php on line 188
I post it here just as a riminder to myself. This is the debug from
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /blogs/inc/items/model/_item.class.php on line 1820
get_edit_link [line 1820]
void get_edit_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $actionurl = '#'] )
Provide link to edit a post if user has edit rights
Parameters:
string $before: to display before link
string $after: to display after link
string $text: link text
string $title: link title
string $class: class name
string $actionurl: page url for the delete action
The original function in inc/items/views/_itms_list_table.views.php lines 180-194 are;
/**
* Edit Actions:
*
* @param Item
*/
function item_edit_actions( $Item )
{
// Display edit button if current user has the rights:
$r = $Item->get_edit_link( ' ', ' ', get_icon( 'edit' ), '#', '' );
// Display delete button if current user has the rights:
$r .= $Item->get_delete_link( ' ', ' ', get_icon( 'delete' ), '#', '', false );
return $r;
}
But I'm stuck here. The HEAD docs only gives;
get_edit_link [line 1796]
void get_edit_link( [ $params = array()] )
Provide link to edit a post if user has edit rights
Parameters:
$params:
so I'm having less $params than arguments from 1.10 and I don't know how to call them.
A few hours sleep does wonders.
In ../blogs/inc/items/views/_item_list_table.view.php change lines 180 - 194:
/**
* Edit Actions:
*
* @param Item
*/
function item_edit_actions( $Item )
{
// Display edit button if current user has the rights:
$r = $Item->get_edit_link( ' ', ' ', get_icon( 'edit' ), '#', '' );
// Display delete button if current user has the rights:
$r .= $Item->get_delete_link( ' ', ' ', get_icon( 'delete' ), '#', '', false );
return $r;
}
in
/**
* Edit Actions:
*
* @param Item
*/
function item_edit_actions( $Item )
{
// Display edit button if current user has the rights:
$r = $Item->get_edit_link( array(
'before' => ' ',
'after' => ' ',
'text' => get_icon( 'edit' ),
'title' => '#',
'class' => '',
)
);
// Display delete button if current user has the rights:
$r .= $Item->get_delete_link( ' ', ' ', get_icon( 'delete' ), '#', '', false );
return $r;
}
and solved.
As blueyed stated: the answer was in the code LOL
Good luck
Yes, thanks for that Afwas. What a relief )
Hi,
I have exactly the same problem when i hit "Post / Comments" - the warning look like this :
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /inc/items/model/_item.class.php on line 1820
i'm using the latest beta, php5, apache2
hi buzzworkers,
This is exactly the error we are talking about, so the solution works for you also ;)
Good luck
:D
Thanks, Afwas. Just committed to CVS.
(the same old API usage is in blogs/inc/items/views/_item_list_track.view.php, too - where I've applied the same patch)
Thanks. Committed to CVS HEAD.