Last modified: 2012-09-21 12:47:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42420, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40420 - cancel button in form page does not submit to previous page
cancel button in form page does not submit to previous page
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
PC Linux
: Unprioritized minor (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-21 08:36 UTC by Francesco Panico
Modified: 2012-09-21 12:47 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
path file. (1.18 KB, patch)
2012-09-21 08:40 UTC, Francesco Panico
Details

Description Francesco Panico 2012-09-21 08:36:11 UTC
Semantic Bundle - version 20120327
Semantic form - version: 2.4.2

To reproduce the bug
Choose a category with a form and a template.
Insert a new instance of that category.
Enter the name of the new instence and submit
You land in form page.
Click Cancell
You will land in the same form page.
You should be landed in the page you enter new instance name

Fix:
file "mediawiki/extensions/SemanticForms/includes/SF_FormUtils.php"
method: "cancelLinkHTML"
Let's apply the attached patch file.
Comment 1 Francesco Panico 2012-09-21 08:40:29 UTC
Created attachment 11133 [details]
path file.

new method:

static function cancelLinkHTML( $is_disabled, $label = null, $attr = array() ) {
		global $wgTitle, $wgParser;

		if ( $label == null ) {
			$label = $wgParser->recursiveTagParse( wfMsg( 'cancel' ) );
		}
		if ( $wgTitle == null ) {
			$cancel = '';
		}
		// if we're on the special 'FormEdit' page, just send the user
		// back to the previous page they were on
		// IMOLA: FIX TS-238
		elseif ( ( strstr($wgTitle,'ModificaDati') || strstr($wgTitle,'FormEdit') ) 
		   && $wgTitle->getNamespace() == NS_SPECIAL ) {
				if (stristr($_SERVER['HTTP_USER_AGENT'], "msie 7")||stristr($_SERVER['HTTP_USER_AGENT'], "msie 8")){
				  $cancel = '<a href="javascript:history.go(-2);">' . $label . '</a>';
				}else{
				  $cancel = '<a href="javascript:history.go(-1);">' . $label . '</a>';
				}

		} else {
			$linker = class_exists( 'DummyLinker' ) ? new DummyLinker() : new Linker();
			$cancel = $linker->link( $wgTitle, $label, array(), array(), 'known' );
		}
		$text = "\t\t<span class='editHelp'>$cancel</span>\n";
		return $text;
	}
Comment 2 Yaron Koren 2012-09-21 12:47:11 UTC
Wow - it looks like that code hasn't been working for a long time; if it ever worked. Thanks for the patch! I just checked in a modified version of this code.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links