diff --git a/frappe/cli.py b/frappe/cli.py
index 8124c9d93b..8b6991cb57 100755
--- a/frappe/cli.py
+++ b/frappe/cli.py
@@ -568,9 +568,10 @@ def clear_all_sessions():
@cmd
def build_website(verbose=False):
- import frappe.website.sync
+ from frappe.website import render, statics
frappe.connect()
- frappe.website.sync.sync(verbose=verbose)
+ render.clear_cache()
+ statics.sync(verbose=verbose).start()
frappe.db.commit()
frappe.destroy()
diff --git a/frappe/core/doctype/comment/comment.py b/frappe/core/doctype/comment/comment.py
index 5a478304bf..b41744a062 100644
--- a/frappe/core/doctype/comment/comment.py
+++ b/frappe/core/doctype/comment/comment.py
@@ -19,7 +19,7 @@ class Comment(Document):
self.update_comment_in_doc()
def update_comment_in_doc(self):
- if self.comment_doctype and self.comment_docname and self.comment:
+ if self.comment_doctype and self.comment_docname and self.comment and self.comment_type=="Comment":
try:
_comments = self.get_comments_from_parent()
updated = False
diff --git a/frappe/hooks.py b/frappe/hooks.py
index 5f1dad5246..bfee5f3e5d 100644
--- a/frappe/hooks.py
+++ b/frappe/hooks.py
@@ -67,9 +67,6 @@ doc_events = {
],
"on_trash": "frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications"
},
- "User Vote": {
- "after_insert": "frappe.website.doctype.website_group.website_group.clear_cache_on_doc_event"
- },
"Website Route Permission": {
"on_update": "frappe.website.doctype.website_group.website_group.clear_cache_on_doc_event"
}
diff --git a/frappe/patches.txt b/frappe/patches.txt
index 1bdeddb05d..d72acccf1a 100644
--- a/frappe/patches.txt
+++ b/frappe/patches.txt
@@ -51,4 +51,4 @@ execute:frappe.db.sql("""update `tabPrint Format` set print_format_type='Client'
frappe.patches.v4_1.file_manager_fix
frappe.patches.v4_2.print_with_letterhead
execute:frappe.delete_doc("DocType", "Control Panel", force=1)
-execute:frappe.delete_doc("DocType", "Website Route", force=1)
+frappe.patches.v4_2.refactor_website_routing
diff --git a/frappe/patches/v4_2/refactor_website_routing.py b/frappe/patches/v4_2/refactor_website_routing.py
new file mode 100644
index 0000000000..eed0cedefe
--- /dev/null
+++ b/frappe/patches/v4_2/refactor_website_routing.py
@@ -0,0 +1,6 @@
+import frappe
+
+def execute():
+ # clear all static web pages
+ frappe.delete_doc("DocType", "Website Route", force=1)
+ frappe.db.sql("drop table `tabWebsite Route`")
diff --git a/frappe/public/build.json b/frappe/public/build.json
index 422ecdeb60..af84cdffb0 100644
--- a/frappe/public/build.json
+++ b/frappe/public/build.json
@@ -12,6 +12,7 @@
"public/js/lib/nprogress.js",
"public/js/frappe/translate.js",
"public/js/frappe/misc/pretty_date.js",
+ "public/js/lib/moment/moment.min.js",
"website/js/website.js",
"website/js/website_group.js"
],
diff --git a/frappe/public/js/legacy/clientscriptAPI.js b/frappe/public/js/legacy/clientscriptAPI.js
index 5cfa219060..91226ac0fb 100644
--- a/frappe/public/js/legacy/clientscriptAPI.js
+++ b/frappe/public/js/legacy/clientscriptAPI.js
@@ -263,8 +263,8 @@ _f.Frm.prototype.new_doc = function(doctype, field) {
_f.Frm.prototype.set_read_only = function() {
var perm = [];
- $.each(frappe.perm.get_perm(cur_frm.doc.doctype), function(i, permlevel) {
- if(permlevel!=null) perm[permlevel] = {read:1};
+ $.each(frappe.perm.get_perm(cur_frm.doc.doctype), function(i, p) {
+ perm[p.permlevel || 0] = {read:1};
});
cur_frm.perm = perm;
}
diff --git a/frappe/templates/includes/navbar.html b/frappe/templates/includes/navbar.html
index a2ad132ddd..b0eb249cae 100644
--- a/frappe/templates/includes/navbar.html
+++ b/frappe/templates/includes/navbar.html
@@ -43,7 +43,8 @@
{% if child.class %} class="{{ child.class }}" {% endif %}>
{%- if child.url -%}
-
+
{%- if child.icon -%}
{%- endif -%}
diff --git a/frappe/templates/includes/sidebar.html b/frappe/templates/includes/sidebar.html
index d83e99d6cc..c359705293 100644
--- a/frappe/templates/includes/sidebar.html
+++ b/frappe/templates/includes/sidebar.html
@@ -1,5 +1,4 @@
-{% set children = doc.get_children() if doc else (get_children() if get_children else []) %}
{% if children -%}
{%- for child in children -%}