Forums

URL Redirection ends processing before normal

pecus 08 Aug, 2008
URL redirection is handled incorrectly in chronocontact.php (as of version V2.5 J1.5 RC3.1). It is processed within the plugins/autogenerated/onsubmit loop, therefore it gets executed at the first iteration, nullifying the execution of the remaining two blocks.
The correct code is attached.

If you want to modify it yourself, change lines 566-583 from this:

			/**
			 * Run the SQL query if there is one
			 */
			if($paramsvalues->autogenerated_order == $ixx){
				if ( !empty($rows[0]->autogenerated) ) {
					eval( "?>".$rows[0]->autogenerated );
				}
			}
	
			/**
			 * Redirect the page if requested
			 */
			if ( !empty($rows[0]->redirecturl) ) {
				$mainframe->redirect($rows[0]->redirecturl);
			}
		}
	}
}

to this:

			/**
			 * Run the SQL query if there is one
			 */
			if($paramsvalues->autogenerated_order == $ixx){
				if ( !empty($rows[0]->autogenerated) ) {
					eval( "?>".$rows[0]->autogenerated );
				}
			}
	
		}
		/**
		 * Redirect the page if requested
		 */
		if ( !empty($rows[0]->redirecturl) ) {
			$mainframe->redirect($rows[0]->redirecturl);
		}
	}
}


pecus
GreyHead 08 Aug, 2008
Hi pecus,

Thanks for the fix. This is a known bug, much reported here.

Bob
pecus 09 Aug, 2008
Tx Greyhead, I searched in the wrong forum (how-to) before finding the fix myself ;-)

Maybe this should be a sticky or a list of known bugs could be posted in the FAQs or in a sticky in all chronoforms forums (or fora which is the cool plural of forum for those who studied latin).

pecus
This topic is locked and no more replies can be posted.