From 4f1a996e6fc09bbde988872520e7e027729f8a30 Mon Sep 17 00:00:00 2001 From: Ali Spittel Date: Wed, 13 Feb 2019 13:43:41 -0500 Subject: [PATCH] Fix tag template issue on editor v1 (#1793) --- app/controllers/articles_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 25711e970..c98e8fbca 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -49,6 +49,12 @@ class ArticlesController < ApplicationController authorize Article Article.new(body_markdown: @tag.submission_template_customized(@user.name), processed_html: "", user_id: current_user&.id) + elsif @tag.present? + authorize Article + Article.new( + body_markdown: "---\ntitle: \npublished: false\ndescription: \ntags: " + @tag.name + "\n---\n\n", + processed_html: "", user_id: current_user&.id + ) else skip_authorization if @user&.editor_version == "v2"