diff --git a/frappe/patches.txt b/frappe/patches.txt index 225671e052..00053673aa 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -1,7 +1,7 @@ execute:frappe.db.sql("""update `tabPatch Log` set patch=replace(patch, '.4_0.', '.v4_0.')""") #2014-05-12 frappe.patches.v5_0.convert_to_barracuda_and_utf8mb4 frappe.patches.v6_1.rename_file_data -execute:frappe.reload_doc('core', 'doctype', 'doctype', force=True) #2016-06-15 +execute:frappe.reload_doc('core', 'doctype', 'doctype', force=True) #2016-07-08 execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2016-02-26 execute:frappe.reload_doc('core', 'doctype', 'docperm') #2014-06-24 execute:frappe.reload_doc('custom', 'doctype', 'custom_field') #2015-10-19 diff --git a/frappe/public/js/frappe/request.js b/frappe/public/js/frappe/request.js index 72a490abac..074fcd80cb 100644 --- a/frappe/public/js/frappe/request.js +++ b/frappe/public/js/frappe/request.js @@ -67,11 +67,12 @@ frappe.request.call = function(opts) { opts.success_callback && opts.success_callback(data, xhr.responseText); }, 401: function(xhr) { - msgprint(__("You have been logged out")); + msgprint({message:__("You have been logged out"), indicator: 'red'}); frappe.app.logout(); }, 404: function(xhr) { - msgprint(__("Not found")); + msgprint({title:__("Not found"), indicator:'red', + message: __('The resource you are looking for is not available')}); }, 403: function(xhr) { if (xhr.responseJSON && xhr.responseJSON._server_messages) { @@ -84,15 +85,17 @@ frappe.request.call = function(opts) { } frappe.utils.play_sound("error"); - msgprint(__("Not permitted")); + msgprint({title:__("Not permitted"), indicator:'red', + message: __('You do not have enough permissions to access this resource. Please contact your manager to get access.')}); }, 508: function(xhr) { frappe.utils.play_sound("error"); - msgprint(__("Another transaction is blocking this one. Please try again in a few seconds.")); + msgprint({title:__('Please try again'), indicator:'red', + message:__("Another transaction is blocking this one. Please try again in a few seconds.")}); }, 413: function(data, xhr) { - msgprint(__("File size exceeded the maximum allowed size of {0} MB", - [(frappe.boot.max_file_size || 5242880) / 1048576])); + msgprint({indicator:'red', title:__('File too big'), message:__("File size exceeded the maximum allowed size of {0} MB", + [(frappe.boot.max_file_size || 5242880) / 1048576])}); }, 417: function(xhr) { var r = xhr.responseJSON; @@ -112,7 +115,7 @@ frappe.request.call = function(opts) { }, 500: function(xhr) { frappe.utils.play_sound("error"); - msgprint(__("Server Error: Please check your server logs or contact tech support.")) + msgprint({message:__("Server Error: Please check your server logs or contact tech support."), title:__('Something went wrong'), indicator: 'red'}); opts.error_callback && opts.error_callback(); frappe.request.report_error(xhr, opts); }, @@ -304,7 +307,7 @@ frappe.request.report_error = function(xhr, request_opts) { request_opts = frappe.request.cleanup_request_opts(request_opts); - var msg_dialog = msgprint(error_message); + var msg_dialog = msgprint({message:error_message, indicator:'red'}); msg_dialog.msg_area.find(".report-btn") .toggle(error_report_email ? true : false) diff --git a/frappe/templates/includes/form_macros.html b/frappe/templates/includes/form_macros.html index d83974cc65..fd3d03374d 100644 --- a/frappe/templates/includes/form_macros.html +++ b/frappe/templates/includes/form_macros.html @@ -4,7 +4,7 @@ {{ key }}="{{ value }}" {% endfor %}{% endif %}> {% if options -%} {% for option in options -%} - {% set option_value = option.value if option is mapping else option %} + {% set option_value = option.value if option is missing else option %} {%- endfor %}