Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author DesignsAndCode

    (@designsandcode)

    If you see another post from just a few hours ago today I actually recommend it ??

    I am using it on my own set ups no problems ??

    Thread Starter lynxmarketing

    (@lynxmarketing)

    Fantastic. Thanks so much for the quick response. So by combining your plugin with Relevanssi, we could (for instance) allow users to search specific taxonomies, or custom category/taxonomy combinations? Like create a custom search bar that only searches for results within the “Support” category or taxonomy?

    Plugin Author DesignsAndCode

    (@designsandcode)

    Exactly that! And then obv you get all the benefits of relevannsi, such as searching in custom fields etc etc ??

    Just to report that it works with Relevanssi when selecting a single category, but apparently not when selecting multiple categories (using the checkbox type selector).

    I’m having the same problem with Relevanssi. It doesn’t work when I’ve selected more than one category. Is there a fix? or perhaps the Pro version will work?

    What does the search results page URL look like when you’ve chosen more than one category?

    Hi Mikko,

    Thanks for asking!

    After some further testing, I found out that Relevannsi is actually working fine with this plugin. The problem probably has to do with the plugin.

    Here’s what the problem is:
    In this first image, you can see that I’ve entered a keyword, set filters for age=8, player number = 4, and game time = 30min.

    View post on imgur.com

    The second image shows the search result. The result is correct, only one article meets the query. However, the problem is it no longer shows all the filters I set. It only shows player number = 4, whereas age and game time displays the default values.

    View post on imgur.com

    Possible reason for the error:
    This page was created by pasting the Search and Filter shortcode into a Page.

    The shortcode is the following:

    [searchandfilter fields=”search,category,cs_playernum,cs_age,cs_gametime,cs_publishyear,cs_editorrating” order_dir=”,,asc,asc,asc,asc,asc” order_by=”,,id,id,id,id,id” types=”,,select,select,select,select,select” hierarchical=”,1,,,,,” headings=”關鍵字,分類,玩家人數,年齡,遊戲時間,出版年份,編輯評分” submit_label=”搜尋”]

    The “cs_….”s are custom categories I created using the WP-type plugin.

    When I saved/updated the page, I get the following Warnings;

    Warning: Invalid argument supplied for foreach() in /home/boardgam/public_html/wp-content/plugins/search-filter/search-filter.php on line 1153

    Warning: Cannot modify header information – headers already sent by (output started at /home/boardgam/public_html/wp-content/plugins/search-filter/search-filter.php:1153) in /home/boardgam/public_html/wp-admin/post.php on line 233

    Warning: Cannot modify header information – headers already sent by (output started at /home/boardgam/public_html/wp-content/plugins/search-filter/search-filter.php:1153) in /home/boardgam/public_html/wp-includes/pluggable.php on line 1173

    search-filter line 1153 starts at foreach

    //loop through all the query vars
    
    			foreach($wp_query->query as $key=>$val)
    
    			{
    
    				if(!in_array(SF_FPRE.$key, $this->frmqreserved))
    
    				{//make sure the get is not a reserved get as they have already been handled above
    
    					//now check it is a desired key
    
    					if(in_array($key, $this->taxonomylist))
    
    					{
    
    						$taxslug = ($val);
    
    						//$tax_params = explode("+",esc_attr($taxslug));
    
    						$tax_params = (preg_split("/[,\+ ]/", esc_attr($taxslug))); //explode with 2 delims
    
    						foreach($tax_params as $tax_param)
    
    						{
    
    							$tax = get_term_by("slug",$tax_param, $key);
    
    							if(isset($tax->term_id))
    
    							{
    
    								$taxs[] = $tax->term_id;
    
    							}
    
    						}
    
    						$this->defaults[SF_FPRE.$key] = $taxs;
    
    					}
    
    				}
    
    			}

    post.php line 233 is setcookie(….. in

    // Session cookie flag that the post was saved
    	if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) {
    		setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS );
    	}

    and pluggable.php line 1173 is header(…. in

    if ( !function_exists('wp_redirect') ) :
    /**
     * Redirects to another page.
     *
     * @since 1.5.1
     *
     * @param string $location The path to redirect to.
     * @param int $status Status code to use.
     * @return bool False if $location is not provided, true otherwise.
     */
    function wp_redirect($location, $status = 302) {
    	global $is_IIS;
    
    	/**
    	 * Filter the redirect location.
    	 *
    	 * @since 2.1.0
    	 *
    	 * @param string $location The path to redirect to.
    	 * @param int    $status   Status code to use.
    	 */
    	$location = apply_filters( 'wp_redirect', $location, $status );
    
    	/**
    	 * Filter the redirect status code.
    	 *
    	 * @since 2.3.0
    	 *
    	 * @param int    $status   Status code to use.
    	 * @param string $location The path to redirect to.
    	 */
    	$status = apply_filters( 'wp_redirect_status', $status, $location );
    
    	if ( ! $location )
    		return false;
    
    	$location = wp_sanitize_redirect($location);
    
    	if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
    		status_header($status); // This causes problems on IIS and some FastCGI setups
    
    	header("Location: $location", true, $status);
    
    	return true;
    }
    endif;

    I’m not a programmer, so I don’t know how these are related and how they might contribute to the problem I have. Any idea?

    Any help will be very much appreciated!!

    Jean

    My search page is at https://www.boardgamelove.com.tw/%E9%80%B2%E9%9A%8E%E6%90%9C%E5%B0%8B/

    Sorry it’s in Chinese!

    The only significant warning is the first, the other two are caused by the first warning, so you don’t have to worry about them – once you fix the first problem, the other warnings will disappear.

    The $tax_params doesn’t contain what the plugin expects it to contain. Add a var_dump($tax_params); before the foreach line and see what it prints out. It should be an array, but for some reason, it probably isn’t.

    Why is that so, I don’t know, because I’m not at all familiar with Search & Filter.

    This is what I got after placing var_dump($tax_params); before the foreach line

    array(1) { [0]=> string(8) “player04” } array(1) { [0]=> string(5) “age08” } array(1) { [0]=> string(6) “time30” }

    And did you still get the error? Because that seems quite correct to me.

    Yes. I still get the error ??

    I did some research,

    foreach (array_expression as $value)
    statement
    foreach (array_expression as $key => $value)
    statement

    So I guess that means there should be a value defined for $tax_param? I searched the php file, it’s not defined. So i did a var_dump($tax_param). What I got is

    NULL string(8) “player04” string(5) “age08”

    Any idea what that means?

    Here’s the foreach function again.

    foreach($tax_params as $tax_param)
    						{
    							$tax = get_term_by("slug",$tax_param, $key);
    
    							if(isset($tax->term_id))
    							{
    								$taxs[] = $tax->term_id;
    							}
    						}

    Actually, never mind that. I misunderstood the foreach function….

    @designsandcode Any idea why this is not working?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Compatible with Relevannsi?’ is closed to new replies.