Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tablesorter and widgets update causes very strange errors with Jquery-based cookie plugin #378

Closed
DevlshOne opened this issue Sep 16, 2013 · 3 comments

Comments

@DevlshOne
Copy link

Last night, I updated my tablesorter scripts, including the widgets and starting having severe problems with my site. All the errors/warnings/notices point at the jquery.cookie.js script (both before and after I upgraded it from the Github site. Here is an excerpt from my php-errors.log file:

[16-Sep-2013 07:58:42 America/New_York] PHP Warning:  Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 80
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP   1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP   2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP   3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:80
[16-Sep-2013 07:58:42 America/New_York] PHP Warning:  Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 81
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP   1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP   2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP   3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:81
[16-Sep-2013 07:58:42 America/New_York] PHP Warning:  Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 82
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP   1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP   2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP   3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:82
[16-Sep-2013 07:58:42 America/New_York] PHP Warning:  Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 83
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP   1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP   2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP   3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:83
[16-Sep-2013 07:58:42 America/New_York] PHP Warning:  Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 84
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP   1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP   2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP   3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:84

The relevant lines from my header.php file:

setcookie('username',$uname,time()+(60*60*24*365)); // renew cookies for another year
setcookie('useremail',$umail,time()+(60*60*24*365));
setcookie('usernum',$unum,time()+(60*60*24*365));
setcookie('userlast',$ulast,time()+(60*60*24*365));
setcookie('userfirst',$ufirst,time()+(60*60*24*365));

And the screen full of errors on my site:

Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 80 Call Stack: 0.0156 140272 1. {main}() C:\inetpub\jms\index.php:0 0.0156 150600 2. include_once('C:\inetpub\jms\header.php') C:\inetpub\jms\index.php:2 0.1248 6136704 3. setcookie(???, ???, ???) C:\inetpub\jms\header.php:80

Why, suddenly, is PHP complaining about headers being sent when all I have before the setcookie lines is my <head> section? Do one of the .js files output anything to the screen? From the latest upgrade, I'm including:

  • js/tablesorter/css/theme.black-ice.css
  • js/tablesorter/jquery.tablesorter.min.js
  • js/tablesorter/jquery.tablesorter.widgets.min.js
  • js/tablesorter/hquery.widgets-filter-formatter.min.js

Please help so I can use the latest version of this great plugin and all of it's very helpful widgets. Thanks

@DevlshOne
Copy link
Author

Well, I was having too many problems with the new version so I downgraded to my older version 2.0.5b, which was working perfectly. Even after the new "repeatHeaders" widget I put together. Now I have removed the new CSS file(s), and copied my old JS scripts back into my site, making sure not to leave any trace of the newer version. All of a sudden, my OLD version isn't sorting anymore!!! Here's what the Console says. Please, I need help quickly, this is a PRODUCTION server with a mission critical app!

image

@DevlshOne DevlshOne reopened this Sep 16, 2013
@Mottie
Copy link
Owner

Mottie commented Oct 8, 2013

Hi @DevlshOne!

Sorry for not responding earlier. I did leave a comment in the StackOverflow question you asked, but I never got a response.

Basically the error you are showing above does not sound like it is related to the plugin, especially if it stopped working after it was reverted back to the original.

Please check this SO answer.

Lastly, the error shown above is because the parser being used with the original version of tablesorter doesn't have a "type" - which is either "numeric" or "text" (see the last line of the code below):

// add parser through the tablesorter addParser method 
$.tablesorter.addParser({ 
    // set a unique id 
    id: 'grades', 
    is: function(s) { 
        // return false so this parser is not auto detected 
        return false; 
    }, 
    format: function(s) { 
        // format your data for normalization 
        return s.toLowerCase().replace(/good/,2).replace(/medium/,1).replace(/bad/,0); 
    }, 
    // set type, either numeric or text 
    type: 'numeric' 
}); 

I'm also not sure how this is related to the repeat headers widget mentioned. But, it really isn't possible to help you with the plugin unless you also share the custom parser/widget and initialization code being used. Better yet, please share a demo or the actual page with the problem.

@Mottie
Copy link
Owner

Mottie commented Oct 11, 2013

Hi @DevlshOne!

I'm guessing this issue has been resolved. If not, please feel free to post a message here for me to reopen it and I will try to assist you further.

@Mottie Mottie closed this as completed Oct 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants