MODx Bug/Feature Tracker and Feature Requests
Welcome to the MODx CMS Tracker. Please choose the appropriate project from the drop down menu and provide as much information as possible regarding your server environment and browser. Thanks!
FS#940 — MODx adds number to pathalias even when 'Allow duplicate aliases' set to 'yes'
Attached to Project —
MODx
Opened by Erik Pols (erikp) - Tuesday, 04 September 2007, 04:43AM
Last edited by Garry Nutting (garryn) - Wednesday, 21 November 2007, 09:43PM
Opened by Erik Pols (erikp) - Tuesday, 04 September 2007, 04:43AM
Last edited by Garry Nutting (garryn) - Wednesday, 21 November 2007, 09:43PM
| Task Type | Bug Report |
|---|---|
| Category | Core Distribution |
| Status | Closed |
| Assigned To |
Jason Coward (opengeek) |
| Operating System | All |
| Severity | High |
|---|---|
| Priority | Normal |
| Reported Version | 0.9.6 |
| Due in Version | 0.9.6.2 |
| Due Date | Undecided |
| Percent Complete |
|
Details
I have 'Allow duplicate aliases' and 'Use friendly alias path' both set to yes. Although MODx indeed allows duplicate aliases, the alias that is automatically generated when saving a new document, gets an added '1' to the alias when the alias already exists. I can manually change that of course but in a multilingual site it's pretty annoying.for example if I have
-> Software
-->Product
->More Softward
-->Product
then the second 'Product' gets the alias 'product1'. I'll try to find a bugfix and post it later
This task depends upon
This task blocks these from closing
in save_content.processor.php, line 61, this code:
// check if ..
$alias .= $cnt;
should be wrapped in an if-statement like this:
if(!$allow_duplicate_alias){
// check if alias already exists. if yes then append $cnt to alias
$cnt = $modx->db->getValue("SELECT count(*) FROM " . $modx->getFullTableName("site_content") . " WHERE id<>'$id' AND alias='$alias'");
if ($cnt > 0)
$alias .= $cnt;
}
- Field changed: Status (Unconfirmed → Implementing)
- Field changed: Due in Version (Undecided → 0.9.6.1)
- Field changed: Due Date (Undecided → Undecided)
- Task assigned to Jason Coward (opengeek)
Thanks for the report and the contributed solution. I will implement this for 0.9.6.1 release.- Field changed: Status (Implementing → Requires testing)
- Field changed: Due in Version (0.9.6.1 → 0.9.6.2)
- Field changed: Percent Complete (0% → 100%)
No worries - just committed on your behalf as SVN rev 3170.