IS there any way to change a document ID ? Short of going into mySQLadmin and manually editing tables?
thanks
-
MODX Staff
- 12,272 Posts
No, and be careful when doing so as there can be other resources linked to document IDs, like TVs.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
If you’re doing it to make the Document Tree look neater, don’t! You’ll get used to it. You’ll serve no practical purpose by doing it, and might break parts of your site.
Quote from: danzg at Jul 20, 2008, 06:30 PM
Arg! Is it possible I am being told there is something that can’t be done in MODx????
Unheard of!!!
Darn. It would be great to have something like that in the Doc Manager Module. My IDs are a mess.
You can definitely do it (people have), but there are certain risks and the improvement is entirely cosmetic. Most of us resisted the urge and learned to live with the document IDs we have. One solution is to reuse the document IDs by overwriting existing documents rather than deleting them.
If you really can’t resist, the safest way is to just create a new MODx install and recreate your documents in the order you want.
-
☆ A M B ☆
- 24,524 Posts
The document IDs are generated automatically by MySQL when the document is created; the ID field is the primary key and is auto-incremented. If you accidentally duplicate one, you can cause all kinds of havoc. Not to mention getting your TVs all messed up, and possibly your site start, error page and unauthorized page settings. Or if you have login page settings for web login or for individual users.
I understand that IDs must be unique, may be links from documents etc.
BUT
Sometimes site admininstrator may create new document, then move it to other place or delete document,
and in result - first document have ID 7, next ID 14, and then ID 8.
When user navigating by site, page adress look like something unsorted, chaotic, user may to think that this site is not proffesional.
So, i think, this feature needed.
You basically have four choices here:
1. Write a module that would renumber the documents and correct all the references to them. It would be a nightmare to write and could easily miss references that would mysteriously bite you later on and be extremely hard to diagnose.
2. Delete all the documents and re-create them in the correct order. Repeat whenever you don’t like the current sequence.
3. Explain to the user why the IDs are not in sequence (only necessary for manager users -- web users never see the IDs).
4. Design the whole site ahead of time and carefully create the documents in the correct order so the IDs *are* in sequence.
Take your pick.
Most of us have opted for number 3.