mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-17 02:22:52 -04:00
Use of existing tag name via input field (#3213)
* Use of existing tag name via input field Use existing tag name, when tag name is typed into tag list's text field * Indentation mistake Just an indentation correction * Final correction Missed line 35.
This commit is contained in:
@@ -33,8 +33,13 @@ class FreshRSS_tag_Controller extends Minz_ActionController {
|
||||
if ($id_entry != false) {
|
||||
$tagDAO = FreshRSS_Factory::createTagDao();
|
||||
if ($id_tag == 0 && $name_tag != '' && $checked) {
|
||||
//Create new tag
|
||||
$id_tag = $tagDAO->addTag(array('name' => $name_tag));
|
||||
if ($existing_tag = $tagDAO->searchByName($name_tag)) {
|
||||
// Use existing tag
|
||||
$tagDAO->tagEntry($existing_tag->id(), $id_entry, $checked);
|
||||
} else {
|
||||
//Create new tag
|
||||
$id_tag = $tagDAO->addTag(array('name' => $name_tag));
|
||||
}
|
||||
}
|
||||
if ($id_tag != 0) {
|
||||
$tagDAO->tagEntry($id_tag, $id_entry, $checked);
|
||||
|
||||
Reference in New Issue
Block a user