Skip to content

A free, self-hostable news aggregator…

Feedback when tag with same name as new category exists (#5181)

obrencklefc7d3d4b5e92
diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php
index 62901c78e..335c0c970 100644
--- a/app/Controllers/categoryController.php
+++ b/app/Controllers/categoryController.php
@@ -28,6 +28,8 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController {
*/
public function createAction() {
$catDAO = FreshRSS_Factory::createCategoryDao();
+ $tagDAO = FreshRSS_Factory::createTagDao();
+
$url_redirect = array('c' => 'subscription', 'a' => 'add');
$limits = FreshRSS_Context::$system_conf->limits;
@@ -51,6 +53,10 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController {
Minz_Request::bad(_t('feedback.sub.category.name_exists'), $url_redirect);
}
+ if ($tagDAO->searchByName($cat->name()) != null) {
+ Minz_Request::bad(_t('feedback.tag.name_exists', $cat->name()), $url_redirect);
+ }
+
$opml_url = checkUrl(Minz_Request::param('opml_url', ''));
if ($opml_url != '') {
$cat->_kind(FreshRSS_Category::KIND_DYNAMIC_OPML);