[SOLVED] WeBid 1.2 item_watch.php creates internal server error

Discussion in 'General Support' started by nay27uk, Jun 1, 2016.

  1. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    In WeBid 1.2 when logged in and in the User Control Panel in the buying tab clicking the link WATCHLIST to load the item_watch.php creates a 500 internal server error, however nothing is logged in the server error logs and nothing is logged in the WeBid admin logs
     
  2. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    Can anyone tell me where the error reporting line has gone from the config.php so I can debug this.

    I notice a new line in the .htaccess now about 500 errors but uncommenting the line for AddDefaultCharset utf-8 and my database is utf-8 (unless we are talking about some other try setting this to your charset) and it makes no difference what so ever, I still get a 500 error when trying to load item_watch.php
     
  3. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    OK I have done some digging around in our server error logs I had to delve quite deep into the server for this but here is the only error I could retrieve.

    Line 54 in item_watch.php is
    PHP:
    $db->query($query$params);
    The whole section of code including line 54 where the error seems to be being triggered from is
    PHP:
    // insert a new watch item
    if (isset($_GET['insert']) && $_GET['insert'] == 'true' && !empty($_REQUEST['add']))
    {
        
    $requestadd $_REQUEST['add'];
        
    // Check if this keyword is not already added
        
    $auctions trim($user->user_data['auc_watch']);
        unset(
    $match); // just incase
        
    if (!empty($auctions))
        {
            
    $checkarray explode(' '$requestadd);
            
    $requestadd '';
            foreach (
    $checkarray as $check)
            {
                if (
    strpos($auctions$check) === false)
                {
                    
    $requestadd .= $check ' ';
                }
            }
        }

        if (!isset(
    $match) || empty($match))
        {
            
    $auction_watch trim($auctions ' ' $requestadd);
            
    $query "UPDATE " $DBPrefix "users SET auc_watch = :auc_watch WHERE id = :id";
            
    $params = array(
                array(
    ':auc_watch'$system->cleanvars($auction_watch), 'str'),
                array(
    ':id'$user->user_data['id'], 'int'),
            );
            
    $db->query($query$params);
            
    $user->user_data['auc_watch'] = $auction_watch;
        }
    }
    NOTE THAT: This error occurs from php 7.6 (latest stable release) right down to PHP 5.4 (with all PDO and MySqli modules installed) Unfortunately I dont have the PHP skills to see where the problem in the code resides.
     
    Last edited: Jun 1, 2016
  4. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    I am thinking it is something to do with the ); on these lines though
    PHP:
            );
            
    $db->query($query$params);
            
    $user->user_data['auc_watch'] = $auction_watch;
        }
    }
    Should that ); not be a }

    I dont know to be honest but something somewhere is a miss
     
  5. timw255

    timw255 Active Member

    Joined:
    Jul 7, 2015
    Messages:
    106
    Likes Received:
    42
  6. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    OK thanks Tim.

    Do you happen to have a copy of the fix that I can download and add to test it out.

    Like I say I want to hardcore test this now and this problem if it is fixed, should have been added to the forums for people testing the latest DOWNLOAD from the homepage here to upload and to try out, preferably before another new version of WeBid that has not been properly tested gets out into the public domain that does not work and is supposed to have been fixed.

    There is no use in just adding fixes to github where most people won't see them or know they have been resolved, we need them posting to the forums also so that people testing can add them and test them out.

    Posting only to github is hiding fixes from most of the members here and as a result testing cant be completed properly as things get missed or forgotten about.
     
    Last edited: Jun 1, 2016
  7. timw255

    timw255 Active Member

    Joined:
    Jul 7, 2015
    Messages:
    106
    Likes Received:
    42
    If it's an option, I'd pull the whole codebase from GitHub and give it a go. There are tons of new commits in the last couple of days.

    if not, the issue was that there is a stray line in item_watch.php, line 54. Something like:

    PHP:
    $match = ;
    It needs removed
     
  8. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    Yeah personally I think that all accepted commits to github should also be released here in the forums on a daily basis or every time a comit is accepted on github they could be posted in a new thread called daily 1.2 accepted github commits and fixes.

    This way all the fixes can get tried out and reported on before a new version of webid gets released to the public.

    Thanks for the above though I will try that out later on as I have to go out for a few hours now.

    I can't be doing with github the site is far to complicated besides that downloading a zip from it includes a load of crap that is never in the final release of webid all the github crap that github add to the zip
     
    Last edited: Jun 1, 2016
  9. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    OK I have posted this thread all wrong it is actualy auction_watch.php that is throwing the internal error not item_watch.php so the above still stands there are no error logs in WeBid or on the server for this error
     
  10. timw255

    timw255 Active Member

    Joined:
    Jul 7, 2015
    Messages:
    106
    Likes Received:
    42
    Can you post a screenshot of the error?
     
  11. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    It's just a internal 500 error standard browser one but here you go I have erased my domain for on and other reasons.

    As I say nothing at all logged in the WeBid error log and nothing at all logged server side either.

    error.jpg
     
  12. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    OK I just realised I had forgotten to compile php with error reporting turned on I turned that on in order to display errors and here is the error returned.
    Code:
    Parse error: syntax error, unexpected '' '' (T_CONSTANT_ENCAPSED_STRING) in /home/auctions/public_html/webidnew/WeBid/auction_watch.php on line 41
    
     
  13. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    OK I just deleted the file from the server and uploaded it fresh fron the WeBid download and it is now working so I am unsure what happened there.

    I will close this thread now
     
  14. timw255

    timw255 Active Member

    Joined:
    Jul 7, 2015
    Messages:
    106
    Likes Received:
    42
    while investigating, I did find an issue deleting items. working on it now.
     
    nay27uk likes this.
  15. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    Good man I will leave the thread open but mark it as SOLVED that way you can still post
     
  16. timw255

    timw255 Active Member

    Joined:
    Jul 7, 2015
    Messages:
    106
    Likes Received:
    42
    commited a fix, will include in the next PR
     
    nay27uk likes this.
  17. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    All getting there slowly Tim, fantastic work by the way pal.
     

Share This Page