diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php index dd54d6df2..183bc13ad 100644 --- a/ext/alias_editor/main.php +++ b/ext/alias_editor/main.php @@ -61,8 +61,8 @@ public function thead(): HTMLElement } $thead->appendChild($tr); - if ($this->create_url) { - $tr = TR(); + $tr = TR(); + if ($this->search_url) { foreach ($this->columns as $col) { $tr->appendChild(TD($col->read_input($this->inputs))); } diff --git a/ext/auto_tagger/main.php b/ext/auto_tagger/main.php index d29138c4b..1719e84f3 100644 --- a/ext/auto_tagger/main.php +++ b/ext/auto_tagger/main.php @@ -63,8 +63,8 @@ public function thead(): HTMLElement } $thead->appendChild($tr); - if ($this->create_url) { - $tr = TR(); + $tr = TR(); + if ($this->search_url) { foreach ($this->columns as $col) { $tr->appendChild(TD($col->read_input($this->inputs))); } @@ -305,38 +305,6 @@ private function add_auto_tag(string $tag, string $additional_tags) $this->apply_new_auto_tag($tag); } - private function update_auto_tag(string $tag, string $additional_tags): bool - { - global $database; - $result = $database->get_row("SELECT * FROM auto_tag WHERE LOWER(tag)=LOWER(:tag)", ["tag"=>$tag]); - - if ($result===null) { - throw new AutoTaggerException("Auto-tag not set for $tag, can't update"); - } else { - $additional_tags = Tag::explode($additional_tags); - $current_additional_tags = Tag::explode($result["additional_tags"]); - - if (!Tag::compare($additional_tags, $current_additional_tags)) { - $database->execute( - "UPDATE auto_tag SET additional_tags = :additional_tags WHERE LOWER(tag)=LOWER(:tag)", - ["tag"=>$tag, "additional_tags"=>Tag::implode($additional_tags)] - ); - - log_info( - AutoTaggerInfo::KEY, - "Updated auto-tag for {$tag} -> {".implode(" ", $additional_tags)."}", - "Updated Auto-Tag" - ); - - // Now we apply it to existing items - $this->apply_new_auto_tag($tag); - return true; - } - } - // Now we apply it to existing items - $this->apply_new_auto_tag($tag); - } - private function apply_new_auto_tag(string $tag) { global $database;