Welcome to Rise Forums

Join our fantastic community to connect with like-minded website owners, WordPress users, and online entrepreneurs.

Widget Framework Error in XenForo

Discussion in 'Forum Management' started by Kevin Muldoon, Jan 29, 2015.

Thread Status:
Not open for further replies.
  1. #1 Kevin Muldoon, Jan 29, 2015
    Last edited: Jan 30, 2015
    Widget Framework is one of the most popular downloads for XenForo. I would call it an essential plugin as it allows you to build the home page sidebar easily. Messages can also be displayed at the top and bottom of pages.

    PHP:
    ErrorExceptionFatal Errorsyntax errorunexpected '!' -library/WidgetFramework/WidgetRenderer.php(498) : runtime-created function:1
    Generated By
    Unknown AccountToday at 12:47 AM

    I am getting the above error every few minutes. I have asked about this in the main discussion thread, however no one has replied as yet.

    Have any Xenforo members encountered this problem and found a way to resolve the error?

    Kevin
     
  2. Attached Files:

  3. I'm on 2.5.9. The problems started after I upgraded to XF 1.4.4.
     
  4. My brother just upgraded us to 1.4.4 yesterday so i might not be seeing anything yet if there are errors. I wonder if it is a bug conflict with something in 2.5.9 and 1.4.4. I will ask him to update our widget and we'll see if we get the errors.
     
  5. Kevin, Check the source code, Line 498 in WidgetRenderer.php, Its syntax error, there is something '!' in somewhere near that line.
     
  6. Thanks Brian.

    @Sanjay Ojha Line 498 of that file is:

    PHP:
    $sandbox = @create_function('$params''extract($params); return (' $expression ');');
    The line is part of a larger function:

    PHP:
    protected function _executeExpression($expression, array $params)
        {
            
    $expression trim($expression);
            if (empty(
    $expression))
                return 
    true;

            
    $sandbox = @create_function('$params''extract($params); return (' $expression ');');

            if (!empty(
    $sandbox))
            {
                return 
    call_user_func($sandbox$params);
            }
            else
            {
                throw new 
    Exception('Syntax error');
            }
        }
    The exclamation mark is only being used with the if statement. There does not seem to be a problem with line 498.
     
  7. Kevin, Codes seems to be fine.
    If you have this code somewhere in development, use below to debug live and see what are the outcomes. This will help to get more details of the error source. If you can not use this code, Tell me, I will give you another code which will log the error instead of displaying and exiting


    PHP:
    protected function _executeExpression($expression, array $params)
        {
            
    $expression trim($expression);
            if (empty(
    $expression))
                return 
    true;

            
    $sandbox = @create_function('$params''extract($params); return (' $expression ');');

           
    // error check
            
    var_dump($params);
            echo 
    '<br/>---------------<br/>';
            
    var_dump($expression);
            echo 
    '<br/>---------------<br/>';
            
    var_dump($sandbox);
            exit;
         
    // end of error check

            
    if (!empty($sandbox))
            {
                return 
    call_user_func($sandbox$params);
            }
            else
            {
                throw new 
    Exception('Syntax error');
            }
        }
     
  8. Thanks Sanjay. I added it to the file temporarily on Rise Forums. It displayed a huge amount of code, but I am unsure as to how to decipher it. I have saved the file for reference.
     
  9. Hi Kevin, Can you give me the output of the code ?
     
  10. Thanks Sanjay. I have sent you an email.
     
Thread Status:
Not open for further replies.

Share This Page