azn137
Member
Posted 5 months ago #
The title says it all, here's the text of the error message:
Warning: array_merge() [function.array_merge]: Argument #2 is not an array in [blah blah]/class-core.php on line 141 (also, line 146)
Any idea why?
http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/
jlapitan
Member
Posted 5 months ago #
azn137
Member
Posted 5 months ago #
Looks like the previous version didn't overload this function, and this one just borked it. Here's the offending function:
function get_option( $option = null ) {
$options = get_option( 'yarpp' );
// ensure defaults if not set:
$options = array_merge( $this->default_options, $options );
// some extra work is required for arrays:
foreach ( $this->default_options as $key => $default ) {
if ( !is_array($default) )
continue;
$options[$key] = array_merge( $this->default_options[$key], $options[$key] );
}
if ( !isset($options['weight']['tax']) )
$options['weight']['tax'] = $this->default_options['weight']['tax'];
if ( is_null( $option ) )
return $options;
$optionpath = array();
$parsed_option = array();
wp_parse_str($option, $parsed_option);
$optionpath = $this->array_flatten($parsed_option);
$current = $options;
foreach ( $optionpath as $optionpart ) {
if ( !is_array($current) || !isset($current[$optionpart]) )
return null;
$current = $current[$optionpart];
}
return $current;
}
What happens if you change line 139 to be
$options = (array) get_option( 'yarpp', array() );
?
rahmis
Member
Posted 5 months ago #
Thanks mitcho. That did the trick for me.
I pushed this hotfix to the 3.4 tag... hopefully wordpress.org will repackage it quickly.
jlapitan
Member
Posted 5 months ago #
how will we know if it has been fixed? an upgrade notification?
The zip archive has been updated. Just download again and replace your files:
http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.4.zip
Thanks for the quick report!
jlapitan
Member
Posted 5 months ago #
thanks! where are the previous settings on the plugin? like the accuracy for related posts
azn137
Member
Posted 5 months ago #
That zip did the trick for me. Thanks.
jlapitan
Member
Posted 5 months ago #
saw it already, screen options
jlapitan
Member
Posted 5 months ago #
why is it that there are no related posts being displayed?
another error i noticed:
when you check the SHOW excerpt this message appears on the textbox
<b>Warning</b>: array_merge() [function.array-merge]: Argument #2 is not an array in <b>/home/mysite/public_html/v2/wp-content/plugins/yet-another-related-posts-plugin/class-core.php</b> on line <b>146</b>
<small>
@jlapitan you'll want to replace your files with the new 3.4 zip.
jlapitan
Member
Posted 5 months ago #
jlapitan
Member
Posted 5 months ago #
uploading manually the plugin.. thanks for the info...
jlapitan
Member
Posted 5 months ago #
why there is still no related posts showing even though i set the treshold to 0..(out of topic)
@jlapitan I'm trying to diagnose an issue where no related posts display for some people. There are instructions here on how to help me figure out this issue:
http://wordpress.org/support/topic/no-related-posts-1?replies=23#post-2464940
Thanks!