Extension:Semantic Forms/MediaWiki red links code change
From MediaWiki.org
The relevant change in the main MediaWiki code to allow for red links to point to an 'add data' form is in the file [MEDIAWIKI_DIR]/includes/Linker.php, within the function makeBrokenLinkObj(). The specific change depends on the version of MediaWiki.
[edit] MediaWiki 1.10 and earlier
Around line 331 of Linker.php, the code:
if ( '' == $query ) {
$q = 'action=edit';
} else {
$q = 'action=edit&'.$query;
}
$u = $nt->escapeLocalURL( $q );
should be changed to:
# special patch for Semantic Forms - see if a default form
# exists for this title, and, if so, link to the form for
# adding this page, instead of the regular Edit page
$u = SFLinkUtils::addDataLink($nt);
if ( '' == $u ) {
if ( '' == $query ) {
$q = 'action=edit';
} else {
$q = 'action=edit&'.$query;
}
$u = $nt->escapeLocalURL( $q );
}
[edit] MediaWiki 1.11 and 1.12
Around line 340 of Linker.php, the code:
if( $nt->getNamespace() == NS_SPECIAL ) {
$q = $query;
} else if ( '' == $query ) {
$q = 'action=edit';
} else {
$q = 'action=edit&'.$query;
}
$u = $nt->escapeLocalURL( $q );
should be changed to:
# special patch for Semantic Forms - see if a default form
# exists for this title, and, if so, link to the form for
# adding this page, instead of the regular Edit page
$u = SFLinkUtils::addDataLink($nt);
if( $nt->getNamespace() == NS_SPECIAL ) {
$q = $query;
$u = $nt->escapeLocalURL( $q );
} else if ('' == $u ) {
if ( '' == $query ) {
$q = 'action=edit';
} else {
$q = 'action=edit&'.$query;
}
$u = $nt->escapeLocalURL( $q );
}
Assuming you already have Semantic MediaWiki and Semantic Forms installed and running, that's all you need to do.