View Issue Details

IDProjectCategoryView StatusLast Update
0012244mantisbtbugtrackerpublic2010-08-06 18:36
Reportermmokluk Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0012244: Upgrading from 1.1.6 to 1.2.1 breaks wiki links for issues
Description

Upgrading from 1.1.6 to 1.2.1 breaks wiki links for issues. In 1.1.6, Mantis used http://$g_wiki_engine_url/index.php/$g_wiki_root_namespace:<bug number>. In 1.2.1, the URL that is generated instead is http://$g_wiki_engine_url/index.php/<project name>:<bug number>.

This causes the wiki link on issues to look in the wrong place for the associated wiki page for any issues with wiki pages that were written prior to the upgrade.

Steps To Reproduce
  • Write a wiki page from the wiki link on an issue in a 1.1.6 mantis instance.
  • upgrade to 1.2.1
  • click on the wiki link for that issue now.
Additional Information

The discrepancy seems to be in the following files:

in 1.1.6 - wiki_mediawiki_api.php in function wiki_mediawiki_get_url_for_page_id

function wiki_mediawiki_get_url_for_page_id( $p_page_id ) {
    $t_root_url = config_get_global( 'wiki_engine_url' );

    $t_root_namespace = config_get( 'wiki_root_namespace' );

    if ( is_blank( $t_root_namespace ) ) {
        $t_page_id = $p_page_id;
    } else {
        <b>$t_page_id = $t_root_namespace . ':' . $p_page_id;</b>
    }

    return $t_root_url . 'index.php/' . urlencode( $t_page_id );
}

vs. in 1.2.1 - MantisCoreWikiPlugin.class.php in function base_url

function base_url( $p_project_id=null ) {
    $t_base = plugin_config_get( 'engine_url' ) . 'index.php/';
    if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
        $t_base .= urlencode( project_get_name( $p_project_id ) ) . ':';
    } else {
        $t_base .= urlencode( plugin_config_get( 'root_namespace' ) );
    }
    return $t_base;
}
TagsNo tags attached.

Activities

mmokluk

mmokluk

2010-08-06 18:36

reporter   ~0026239

Is there a reason why the project name was added in place of the root namespace? I don't want to break new features by just patching this to point to the old URL.