Forums

Redirect headers already sent ERROR

ceewee 05 Mar, 2016
Till now I was very happy with Chronoforms using for Joomla. Since I do more and more Sites with Wordpress, I was also very happy to see the plugin for WP. I am not a develeoper and need a Formmail Tool that´s easy to handle.

Now I am getting an Error while a simple redirect.
The redirecr ist the last action on the on submit event.
Checkt it on 2 themes, but both done with "virtual composer"
I checkt a lot of posibilities. Field Names, Did it on a second Projekt...nothing helps.

This is the Alert:

Warning: Cannot modify header information - headers already sent by (output started at /kunden/90564_30926/webseiten/DOMAINXXX/wordpress/north/wp-includes/nav-menu-template.php:454) in /kunden/90564_30926/webseiten/DOMAINXXX/wordpress/north/wp-content/plugins/chronoforms/cegcore/libs/env.php on line 6

it must have something to do with this function:

public static function redirect($url){
header('Location: '.str_replace('&', '&', $url));
ob_end_flush();
exit();

but I am not good enough to check this.
Am I the only one who got this problems on two WP Project?

nice weekend
ceewee
GreyHead 05 Mar, 2016
Hi ceewee,

No immediate suggestions; please post a link to the form so I can take a quick look.

Bob
ceewee 05 Mar, 2016
I´m astonished how busi the GreyHead is!! ;-)

Here is the Form:
http://spitze-n-kraft.de/wordpress-website-anfrage?uf=2

thanx
GreyHead 05 Mar, 2016
Hi ceewee,

Please will you open the file wordpress/north/wp-content/plugins/chronoforms/cegcore/libs/env.php and copy the first dozen lines here. Line 6 is a comment in the version I have here.

Bob
ceewee 05 Mar, 2016
OK, Line 6 was because I deleted the Comments, as I was looking for Spaces the force such Errors.
I replaced it now with the original one und now the Error ist again on line 15

<?php
/**
* ChronoCMS version 1.0
* Copyright (c) 2012 ChronoCMS.com, All rights reserved.
* Author: (ChronoCMS.com Team)
* license: Please read LICENSE.txt
* Visit http://www.ChronoCMS.com for regular updates and information.
**/
namespace GCore\Libs;
/*** FILE_DIRECT_ACCESS_HEADER ***/
defined("GCORE_SITE") or die;
class Env {

	public static function redirect($url){
		header('Location: '.str_replace('&', '&', $url));
		ob_end_flush();
		exit();
	}




Warning: Cannot modify header information - headers already sent by (output started at /kunden/90564_30926/webseiten/spitzenkraft/wordpress/north/wp-includes/nav-menu-template.php:454) in /kunden/90564_30926/webseiten/spitzenkraft/wordpress/north/wp-content/plugins/chronoforms/cegcore/libs/env.php on line 15
GreyHead 05 Mar, 2016
Hi ceewee,

That explains the line numbers thank you.

I don't see quite where the error is :-(

You might try using the WP redirect method in a Custom Code action instead of the ReDirect action.

Bob
ceewee 06 Mar, 2016
Im not sure if this is correct:
<?php wp_redirect( 'http://spitze-n-kraft.de/danke-fuer-ihre-anfrage', 301 ); exit; ?>

getting now:
Warning: Cannot modify header information - headers already sent by (output started at /kunden/90564_30926/webseiten/spitzenkraft/wordpress/north/wp-includes/nav-menu-template.php:454) in /kunden/90564_30926/webseiten/spitzenkraft/wordpress/north/wp-includes/pluggable.php on line 1228

Meanwhile I checked a third Projekt. There I build only 3 Forms with Chronoforms on the default Theme of WP.
I only used the "Display Message". Now i testet a redirect and get the same Error.
It looks like the reason for that hase to be found at the Chronoform-plugin and not at WP.
😟
GreyHead 06 Mar, 2016
Hi ceewee,

I don't know - the first error doesn't look as though it is from ChronoForms, the redirect one might be.

I don't' remember seeing this particular error reported here before. I know that there have been some conflicts with other WP Plug-ins.I'll try to run a test on a WP Installation when I can.

Bob
ceewee 07 Mar, 2016
I found out, that in the mainproject "spitze-n-kraft" the plugin
"ubermenu 3" causes the error.
If deaktivated no error!
But I need the plugin, because the coders for the theme deliver a menu that is not working on Android Smartphones...

I installt the latest update from the Theme and from the ubermenu....no changes...

I´m getting sad....not enough time for those things...:-(
GreyHead 07 Mar, 2016
HI ceewee,

I suggest that you try the UberMenu support - it may be just that there is a space output somewhere. Or they may be able to pin down why there is a problem with the ChronoForms & WordPress redirect codes.

You can also ask Max, the owner and developer here, using the Contact Us menu above and linking to this thread - it's just possible that he has seen this before.

Bob
ceewee 07 Mar, 2016
I contacted the ubermenu support,
but I don´t think that the can help.
As I said, I testet it on a WP Installation without plugins and with the default WP theme and the same error occurred.
GreyHead 07 Mar, 2016
Hi ceewee,

Please check with Max as I suggested, he may have some suggestions.

Bob
Max_admin 07 Mar, 2016
Hi,

I get the same error with the redirect action here, but you said that you could solve it by disabling some plugin, however, when I search on Google "Warning: Cannot modify header information - headers already sent by", I find lots of similar reported errors coming from different WordPress files, so I don't think this issue can be solved easily.

You may however use this workaround:
http://stackoverflow.com/questions/503093/how-can-i-make-a-page-redirect-using-jquery?rq=1

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.