1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Number of variables doesn't match number of parameters in prepared statement

Discussion in 'Resolved Bug Reports' started by Romchik®, Oct 19, 2011.

  1. Romchik®

    Romchik® Well-Known Member

    2 computers and 2 installed copies of the XF on the localhost for testing.

    Yesterday I updated the first copy at home with beta 3. Then I updated a couple of styles. I exported the XML files and take them to work.

    At work, I also updated the forum with beta 3. I'm trying to import styles and get an error.
    On a computer at work, I use the XAMPP server 1.7.4 (PHP: 5.3.5).

    Although previously hadn't any problems.
     
  2. ragtek

    ragtek Guest

    I think that's a bug in XenForo_Model_Template

    PHP:
    $db->query('
                    DELETE FROM xf_template_compiled
                    WHERE style_id = 0
                        AND title IN (' 
    $db->quote($titles) . ')
                '
    $styleId);
    should probably be
    PHP:
    $db->query('
                    DELETE FROM xf_template_compiled
                    WHERE style_id = 0
                        AND title IN (' 
    $db->quote($titles) . ')
                '
    );
     
  3. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    If you want a workaround, instead of replacing the style, import it as a new style. That will work. You can then delete the other style.
     
    Romchik® likes this.
  4. Romchik®

    Romchik® Well-Known Member

    ragtek, and what about this error? :)
     
  5. Romchik®

    Romchik® Well-Known Member

    hm...
    My style contains the following CSS in EXTRA.css:
    Code:
    background-color:@primaryLight;
    
    ...
    
    background:url('@imagePath/xenforo/gradients/category-23px-light.png') repeat-x top;
    ...
    
    margin-left:-{xen:calc '@content.padding-right + 5'}px;
    
    I have replaced with:
    Code:
    background-color:{xen:property primaryLight};
    
    ...
    
    background:url('{xen:property imagePath}/xenforo/gradients/category-23px-light.png') repeat-x top;
    
    ...
     
    margin-left:-{xen:calc '{xen:property content.padding-right} + 5'}px;
    And error above (Line 464: Invalid math expression) has gone...
     
  6. Mike

    Mike XenForo Developer Staff Member

    That section of code should actually be:

    Code:
                $db->query('
                    DELETE FROM xf_template_compiled
                    WHERE style_id = ?
                        AND title IN (' . $db->quote($titles) . ')
                ', $styleId);
                if (XenForo_Application::get('options')->templateFiles)
                {
                    XenForo_Template_FileHandler::delete($titles, $styleId, null);
                }
     
    Romchik® likes this.

Share This Page