Better syntax formating for SQL query related to comments module.

Display import link from admin page.
Removed unused local variables.
This commit is contained in:
2017-02-01 10:29:15 +01:00
parent c10faceaf6
commit fae444c238
3 changed files with 8 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
note
description: "Summary description for {CMS_ADMIN_RESPONSE}."
description: "Response for the /admin request."
date: "$Date$"
revision: "$Revision$"
@@ -29,6 +29,7 @@ feature -- Process
l_admin_links.force (["core", <<"view logs">>, local_link ("Logs", "admin/logs"), "View logs"])
l_admin_links.force (["support", <<"admin cache">>, local_link ("Cache", "admin/cache"), "Clear caches"])
l_admin_links.force (["support", <<"admin export">>, local_link ("Export", "admin/export"), "Export CMS contents, and modules contents."])
l_admin_links.force (["support", <<"admin import">>, local_link ("Export", "admin/import"), "Import CMS contents, and modules contents."])
create categories.make_caseless (3)
across
l_admin_links as ic

View File

@@ -1,7 +1,7 @@
note
description: "Interface for accessing user profile contents from SQL database."
date: "$Date: 2015-05-21 14:46:00 +0100$"
revision: "$Revision: 96616 $"
revision: "$Revision: 99775 $"
class
CMS_COMMENTS_STORAGE_SQL
@@ -86,7 +86,7 @@ feature -- Change
l_parameters.put (a_comment.modification_date, "changed")
l_parameters.put (a_comment.status, "status")
if attached a_comment.parent as p then
if attached a_comment.parent as p and then p.has_id then
l_parameters.put (p.id, "parent")
else
l_parameters.put (0, "parent")
@@ -180,11 +180,11 @@ feature {NONE} -- Queries
Sql_last_inserted_comment_id: STRING = "SELECT MAX(cid) FROM comments;"
sql_select_comment_by_id: STRING = "SELECT cid,content,format,author,author_name,created,changed,status,parent,entity,entity_type FROM comments WHERE cid=:cid;"
sql_select_comment_by_id: STRING = "SELECT cid, content, format, author, author_name, created, changed, status, parent, entity, entity_type FROM comments WHERE cid=:cid ;"
sql_select_comments_for_content: STRING = "SELECT cid,content,format,author,author_name,created,changed,status,parent,entity,entity_type FROM comments WHERE entity=:content_id;"
sql_select_comments_for_content: STRING = "SELECT cid, content, format, author, author_name, created, changed, status, parent, entity, entity_type FROM comments WHERE entity=:content_id ;"
sql_insert_comment: STRING = "INSERT INTO comments (content,format,author,author_name,created,changed,status,parent,entity,entity_type) VALUES (:content,:format,:author,:author_name,:created,:changed,:status,:parent,:entity,:entity_type);"
sql_update_comment: STRING = "UPDATE comments SET content=:content,format=:format,author=:author,author_name=:author_name,created=:created,changed=:changed,status=:status,parent=:parent,entity=:entity,entity_type=:entity_type WHERE cid=:cid ;"
sql_insert_comment: STRING = "INSERT INTO comments (content, format, author, author_name, created, changed, status, parent, entity, entity_type) VALUES (:content, :format, :author, :author_name, :created, :changed, :status, :parent, :entity, :entity_type) ;"
sql_update_comment: STRING = "UPDATE comments SET content=:content, format=:format, author=:author, author_name=:author_name, created=:created, changed=:changed, status=:status, parent=:parent, entity=:entity, entity_type=:entity_type WHERE cid=:cid ;"
end

View File

@@ -25,8 +25,6 @@ feature -- Comments helpers
import_comments_file_for_entity (fn: PATH; a_entity: CMS_CONTENT; api: CMS_API; a_import_ctx: CMS_IMPORT_CONTEXT)
local
s: STRING
jp: JSON_PARSER
l_comment: CMS_COMMENT
l_log: STRING_8
do