Commit 6819ba50 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4954 (Content with numeric titles fails to generate any moniker)

parent b3768136
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -116,9 +116,12 @@ Alternatively you can reference it in your [tt]robots.txt[/tt] file, as shown in
[title="2"]URL Monikers[/title]

The Composr URL moniker feature will put keywords into the URLs instead of ID numbers, which is great for SEO but also makes the URLs more comprehensible to humans.
The keywords are found by processing some source text, typically the content title.

The URL monikers option can be enabled/disabled via the "URL monikers enabled" option.

Note that URL monikers will be given a leading hyphen if the source text is fully numeric. This is because URL monikers cannot be numbers as they would look like raw content IDs.

One small disadvantage of URL Monikers, is it makes it a bit harder to find out ID numbers, as you can't just look in URLs. However, you can still find them on edit links, or if you look in the HTML source you will often see:
[code="HTML"]
<meta name="DC.Identifier" content="http://yourbaseurl/data/page_link_redirect.php?id=_SEARCH%3Asomemodule%3Aview%3A13" />
+4 −11
Original line number Diff line number Diff line
@@ -739,9 +739,6 @@ function suggest_new_idmoniker_for($page, $type, $id, $zone, $moniker_src, $is_n
    }

    if ($moniker === null) {
        if (is_numeric($moniker_src)) {
            $moniker = $id; // No need for a proper moniker, as it would just be a number (which is not a valid moniker)
        } else {
        $scope = _give_moniker_scope($page, $type, $id, $zone, '');
        $moniker = $scope . _choose_moniker($page, $type, $id, $moniker_src, null, $scope);

@@ -749,7 +746,6 @@ function suggest_new_idmoniker_for($page, $type, $id, $zone, $moniker_src, $is_n
            $moniker .= '-' . str_pad($id, 3, '0', STR_PAD_LEFT);
        }
    }
    }

    // Insert
    $GLOBALS['SITE_DB']->query_delete('url_id_monikers', array(    // It's possible we're re-activating a deprecated one
@@ -800,9 +796,6 @@ function _choose_moniker($page, $type, $id, $moniker_src, $no_exists_check_for =
    // Check it does not already exist
    $moniker_origin = $moniker;
    $next_num = 1;
    if (is_numeric($moniker)) {
        $moniker .= '-1';
    }
    $test = mixed();
    do {
        if (!is_null($no_exists_check_for)) {