Jump to content

Custom Friendly URLs keep disappearing


Linguica

Recommended Posts

Posted

For some reason IPS keeps deleting existing custom friendly URLs when I try and create a new one. This is sub optimal.

Example:

  1. Create custom FURL, in this case, vb/getnew
  2. Create a second custom FURL, in this case, vb/{?}/{#id}-{?}
  3. Note that vb/getnew is now gone
  4. Re-add vb/getnew
  5. Note that vb/{?}/{#id}-{?} is now missing instead

Why does this keep happening? I will note that I (purposely) have several custom FURLS set up to point to the same internal URLS, e.g., vb/getnew is identical to discover/unread. This should not be a problem, should it?

 

Posted

I looked in core_sys_conf_settings at furl_configuration before and after trying to add a new one:

Before:

{
    "key2": {
        "friendly": "vb",
        "real": "app=forums&module=forums&controller=index",
        "custom": true,
        "regex": [
            "vb"
        ],
        "params": []
    },
    "key3": {
        "friendly": "vb/post/{#comment}",
        "real": "app=forums&module=forums&controller=topic&do=findComment",
        "custom": true,
        "regex": [
            "vb\\/post\\/(\\d+?)"
        ],
        "params": [
            "comment"
        ]
    },
    "forums_topic": {
        "friendly": "forum/topic/{#id}-{?}",
        "real": "app=forums&module=forums&controller=topic",
        "verify": "\\IPS\\forums\\Topic",
        "custom": true,
        "with_top_level": "forums/forum/topic/{#id}-{?}",
        "regex": [
            "forum\\/topic\\/(\\d+?)\\-(?!&)(.+?)",
            "forums\\/forum\\/topic\\/(\\d+?)\\-(?!&)(.+?)"
        ],
        "params": [
            "id",
            ""
        ]
    },
    "key5": {
        "friendly": "vb/thread/{#id}",
        "real": "app=forums&module=forums&controller=topic",
        "custom": true,
        "regex": [
            "vb\\/thread\\/(\\d+?)"
        ],
        "params": [
            "id"
        ]
    },
    "key6": {
        "friendly": "vb/{?}/{#id}-{?}/{#page}",
        "real": "app=forums&module=forums&controller=topic",
        "custom": true,
        "regex": [
            "vb\\/(?!&)(.+?)\\/(\\d+?)\\-(?!&)(.+?)\\/(\\d+?)"
        ],
        "params": [
            "",
            "id",
            "",
            "page"
        ]
    },
    "key7": {
        "friendly": "vb/{?}/{#id}-{?}",
        "real": "app=forums&module=forums&controller=topic",
        "custom": true,
        "regex": [
            "vb\\/(?!&)(.+?)\\/(\\d+?)\\-(?!&)(.+?)"
        ],
        "params": [
            "",
            "id",
            ""
        ]
    }
}

And after:

{
    "key2": {
        "friendly": "vb",
        "real": "app=forums&module=forums&controller=index",
        "custom": true,
        "regex": [
            "vb"
        ],
        "params": []
    },
    "key3": {
        "friendly": "vb/post/{#comment}",
        "real": "app=forums&module=forums&controller=topic&do=findComment",
        "custom": true,
        "regex": [
            "vb\\/post\\/(\\d+?)"
        ],
        "params": [
            "comment"
        ]
    },
    "forums_topic": {
        "friendly": "forum/topic/{#id}-{?}",
        "real": "app=forums&module=forums&controller=topic",
        "verify": "\\IPS\\forums\\Topic",
        "custom": true,
        "with_top_level": "forums/forum/topic/{#id}-{?}",
        "regex": [
            "forum\\/topic\\/(\\d+?)\\-(?!&)(.+?)",
            "forums\\/forum\\/topic\\/(\\d+?)\\-(?!&)(.+?)"
        ],
        "params": [
            "id",
            ""
        ]
    },
    "key5": {
        "friendly": "vb/thread/{#id}",
        "real": "app=forums&module=forums&controller=topic",
        "custom": true,
        "regex": [
            "vb\\/thread\\/(\\d+?)"
        ],
        "params": [
            "id"
        ]
    },
    "key6": {
        "friendly": "vb/{?}/{#id}-{?}/{#page}",
        "real": "app=forums&module=forums&controller=topic",
        "custom": true,
        "regex": [
            "vb\\/(?!&)(.+?)\\/(\\d+?)\\-(?!&)(.+?)\\/(\\d+?)"
        ],
        "params": [
            "",
            "id",
            "",
            "page"
        ]
    },
    "key7": {
        "friendly": "vb/getnew",
        "real": "app=core&module=discover&controller=streams&id=1",
        "custom": true,
        "regex": [
            "vb\\/getnew"
        ],
        "params": []
    }
}

So whatever is happening, it's causing "key7" to get overwritten with the latest one I create.

Posted

Well, I managed to fix it, although I should probably submit a bug report as well.

In short:

  • If you're creating a new furl as opposed to editing a default one, it generates a key for it by counting the number of existing custom furls, adding 1 to that number, and then writing it with the key value of "key#"
  • Somehow in creating / deleting furls mine had gotten into the state where the last one was labelled "key7" despite there only being 6 custom furls
  • Every time I tried to make a new furl, it counted 6 furls and then created a new one with key "key7"

The solution for me was to go into the database and manually edit all the keys so that the highest one was "key6" and then refresh the caches.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...