Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r16563 -r16591 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16563) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16591) @@ -1,6 +1,6 @@ getObject(); + + $friendly_url = $object->GetDBField('FriendlyURL'); + + if ( strlen($friendly_url) && $friendly_url != $object->GetOriginalField('FriendlyURL') ) { + $sql = 'SELECT CategoryId + FROM %s + WHERE NamedParentPath = ' . $this->Conn->qstr('Content/' . $friendly_url); + $duplicate_id = $this->Conn->GetOne(sprintf($sql, $object->TableName)); + + if ( $duplicate_id === false && $object->IsTempTable() ) { + $duplicate_id = $this->Conn->GetOne(sprintf( + $sql, + $this->Application->GetLiveName($object->TableName) + )); + } + + if ( $duplicate_id !== false ) { + $object->SetError('FriendlyURL', 'unique'); + } + } + } + + /** * Sets correct status for new categories created on front-end * * @param kEvent $event Index: branches/5.2.x/core/install/english.lang =================================================================== diff -u -N -r16588 -r16591 --- branches/5.2.x/core/install/english.lang (.../english.lang) (revision 16588) +++ branches/5.2.x/core/install/english.lang (.../english.lang) (revision 16591) @@ -268,6 +268,7 @@ RW1haWwgRGVzaWduIFRlbXBsYXRlIHNob3VsZCBjb250YWluIGF0IGxlYXN0ICIkYm9keSIgdGFnIGluIGl0Lg== RmlsZSBub3QgZm91bmQ= RmlsZSBpcyB0b28gbGFyZ2U= + VGhpcyBVUkwgaXMgY29uZmxpY3Rpbmcgd2l0aCBleGlzdGluZyBVUkwgYW5kIGNhbid0IGJlIHVzZWQ= Z3JvdXAgbm90IGZvdW5k RmllbGQgZG9lc24ndCBleGlzdCBpbiAiJXMiIHVuaXQgY29uZmln SW52YWxpZCBGaWxlIEZvcm1hdA== Index: branches/5.2.x/core/units/categories/categories_config.php =================================================================== diff -u -N -r16577 -r16591 --- branches/5.2.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 16577) +++ branches/5.2.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 16591) @@ -1,6 +1,6 @@ NULL ), 'FormSubmittedTemplate' => Array ('type' => 'string', 'default' => null), - 'FriendlyURL' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'FriendlyURL' => Array ( + 'type' => 'string', + 'unique' => array(), + 'error_msgs' => array('unique' => '!la_error_FriendlyUrlIsNotUnique!'), + 'not_null' => 1, 'default' => '', + ), 'ThemeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'EnablePageCache' => Array (