From 5cce7cb5197380980f59abf6c2098afde58f9082 Mon Sep 17 00:00:00 2001 From: Scott Hutchinson Date: Sun, 18 Nov 2018 14:08:53 +1300 Subject: [PATCH 1/2] FIX app email templates not resolving correctly --- code/Model/Recipient/EmailRecipient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index 0c686a4..8201842 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -506,8 +506,8 @@ class EmailRecipient extends DataObject $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1); // Optionally remove "templates/" prefixes - if (substr($templatePath, 0, 10)) { - $templatePath = substr($templatePath, 10); + if (preg_match('/(?<=templates\/).*$/', $templatePath, $matches)) { + $templatePath = $matches[0]; } $templates[$templatePath] = $template['filename']; From 0977002acccdef3f9f22e6d8111b09649735f699 Mon Sep 17 00:00:00 2001 From: Guy Van Bael Date: Mon, 3 Dec 2018 09:30:11 +0100 Subject: [PATCH 2/2] changes regex for de and nl so dates validate correctly --- client/thirdparty/jquery-validate/localization/methods_de.js | 2 +- .../thirdparty/jquery-validate/localization/methods_de.min.js | 2 +- client/thirdparty/jquery-validate/localization/methods_nl.js | 2 +- .../thirdparty/jquery-validate/localization/methods_nl.min.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/thirdparty/jquery-validate/localization/methods_de.js b/client/thirdparty/jquery-validate/localization/methods_de.js index 470133e..4e9980d 100755 --- a/client/thirdparty/jquery-validate/localization/methods_de.js +++ b/client/thirdparty/jquery-validate/localization/methods_de.js @@ -12,7 +12,7 @@ */ $.extend($.validator.methods, { date: function(value, element) { - return this.optional(element) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value); + return this.optional(element) || /^[\d]{1,4}\-[0-1][0-9]\-[0-3][0-9]?$/.test(value); }, number: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); diff --git a/client/thirdparty/jquery-validate/localization/methods_de.min.js b/client/thirdparty/jquery-validate/localization/methods_de.min.js index 0cfea5e..4c64e3e 100755 --- a/client/thirdparty/jquery-validate/localization/methods_de.min.js +++ b/client/thirdparty/jquery-validate/localization/methods_de.min.js @@ -1,4 +1,4 @@ /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 * http://jqueryvalidation.org/ * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(a)}})}); \ No newline at end of file +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^[\d]{1,4}\-[0-1][0-9]\-[0-3][0-9]?$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(a)}})}); \ No newline at end of file diff --git a/client/thirdparty/jquery-validate/localization/methods_nl.js b/client/thirdparty/jquery-validate/localization/methods_nl.js index 91e0d8c..d033509 100755 --- a/client/thirdparty/jquery-validate/localization/methods_nl.js +++ b/client/thirdparty/jquery-validate/localization/methods_nl.js @@ -12,7 +12,7 @@ */ $.extend($.validator.methods, { date: function(value, element) { - return this.optional(element) || /^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(value); + return this.optional(element) || /^[\d]{1,4}\-[0-1][0-9]\-[0-3][0-9]?$/.test(value); } }); diff --git a/client/thirdparty/jquery-validate/localization/methods_nl.min.js b/client/thirdparty/jquery-validate/localization/methods_nl.min.js index b3fa94a..f527c37 100755 --- a/client/thirdparty/jquery-validate/localization/methods_nl.min.js +++ b/client/thirdparty/jquery-validate/localization/methods_nl.min.js @@ -1,4 +1,4 @@ /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 * http://jqueryvalidation.org/ * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(a)}})}); \ No newline at end of file +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^[\d]{1,4}\-[0-1][0-9]\-[0-3][0-9]?$/.test(a)}})}); \ No newline at end of file