Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
2.1k views
in Plugins by
edited by

I updated the latest version of on-site-notification plugin and it works fine. But when I visited the plugin section of my website in the admin then it started to show warnings. What to do for these. 

 


Warning: Cannot modify header information - headers already sent by (output started at /home3/name1/public_html/name/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php:1) in /home3/name1/public_html/name/qa-include/qa-page.php on line 734

Warning: Cannot modify header information - headers already sent by (output started at /home3/name1/public_html/name/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php:1) in /home3/name1/public_html/name/qa-include/qa-page.php on line 224

Warning: Cannot modify header information - headers already sent by (output started at /home3/name1/public_html/name/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php:1) in /home3/name1/public_html/name/qa-include/qa-page.php on line 363

One more warning has started to show. Please help me with this.

Warning: Cannot modify header information - headers already sent by (output started at /home3/name1/public_html/website.com/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php:1) in /home3/name1/public_html/website.com/qa-include/qa-base.php on line 1366

Q2A version: 1.6.3

1 Answer

0 votes
by

Checking qa-page.php in v1.6.3 I see on line 734:

setcookie('qa_noticed', 1, time()+86400*3650, '/', QA_COOKIE_DOMAIN); // don't show first-time notice if a user has logged in

Line 224 also sets a cookie. Line 363 sets a header.

If this warning only appears in the admin/plugin section, you might want to modify file "q2apro-onsitenotifications-admin.php".

Because you have installed the plugin already, please try to remove the entire block of "function init_queries($tableslc) {...}" and see if the warning error still appears.

by
I am not that good in coding and stuff, so can you tell me where exactly I have to remove the block of function that you mentioned??
by
@q2apro can you please reply me on this.
by
As I wrote, remove the lines from:
init_queries($tableslc) {
...
} // the according closing bracket
by
but I am asking where I can find init_queries($tableslc){  ??????
I couldn't find any file naming this in entire q2a...
by
q2apro-onsitenotifications-admin.php
by
warnings are still there, I removed all the the lines between
 function init_queries($tableslc).......... to .......... } // end init_queries
but still there is no change. Now what to do.
by
Can you check if you find the following entries in database table qa_options:
event_logger_to_database = 1
event_logger_to_files = (empty)
event_logger_directory = (empty)
event_logger_hide_header = (empty)
q2apro_onsitenotifications_enabled = 1
q2apro_onsitenotifications_maxage = 365
q2apro_onsitenotifications_maxevshow = 100
q2apro_onsitenotifications_nill = N
by
this is how all these are showing in my database.
event_logger_to_database = 1
event_logger_to_files = 1
event_logger_directory = (empty)
event_logger_hide_header = (empty)
q2apro_onsitenotifications_enabled = 1
q2apro_onsitenotifications_maxage = 365
q2apro_onsitenotifications_maxevshow = 100
q2apro_onsitenotifications_nill = Yo
by
Can you remove the "1" from "event_logger_to_files" and see if this solves your problem.
by
the problem still persists, no change is there even after removing 1. Now what I have to do?
And should I again place 1 back there or it should be like this only?
by
Mhhh, we have to find out what is throwing the error message. To explain: Above the messages say, it is tried to set a cookie and output a header, problem is that the plugin sent already headers (an output). Question is, what (error?) has been sent.

Ah, I just see now that the file responsible seems to be q2apro-onsitenotifications-page.php regarding your warning message. But I cannot see a problem there since the file has a default structure. I try to check on this tonight again.
by
I would be waiting for your reply.
by
have you found out any reason for this now...??
by
As you are the only one with this problem, could it be that you have other plugins running that interfer? Maybe the history plugin?
by
I have never used history plugin in any of my q2a websites, just your on-site-notification plugin.
by
1. Please download the latest version and update your plugin: http://www.q2apro.com/plugins/on-site-notifications

2. What do you see when you open the URL yourwebsite.com/eventnotify ?

3. Check the network connections with Firefox WebDeveloper. Are all requests okay?

4. What version of question2answer do you have?
by
1. I just downloaded the latest version of the plugin you have on your q2apro and uploaded it, but no change is there.
2. I see my website only but the main content area is blank.
3. Every request and every operation so far looks perfectly ok, no warnings or errors are shown there.
4. I am using the latest official released version of q2a i.e. 1.6.3
by
What to do now??
by
You could set outputs (for instance with var_dump("1"); 2, 3 etc. or error_log() ) on certain code positions and thus find out where the error gets triggered.

The problem is that the error notice is not telling us where the actual problem lies. Furthermore you are the only one having this problem. And I have no access to your environment. All in all quite difficult to debug.
by
I have sent you a message please check that.
by
I updated the plugin on your server to the latest version, now it works without any errors.  Please keep your plugins always up-to-date. Thx, Kai
by
Thanks for your help, but I had uploaded the latest plugin around 10 days back but the errors were there.
It means that you have updated the plugin in the last week but I never got any notification to update the plugin in the plugin section?
by
I got the problem now. Thanks for your help.
...