From 1da684b529f8adc6624b0b24bd83045860acb380 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 29 Aug 2024 16:25:18 +0530 Subject: [PATCH 1/8] fix mailer patch --- patches/037-mailer-template-fix.patch | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 patches/037-mailer-template-fix.patch diff --git a/patches/037-mailer-template-fix.patch b/patches/037-mailer-template-fix.patch new file mode 100644 index 0000000..de98d91 --- /dev/null +++ b/patches/037-mailer-template-fix.patch @@ -0,0 +1,43 @@ +From: Avinash +Date: Thu, 29 Aug 2024 15:50:00 +0530 +Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We also created the PR so may be if that got merge +This May not be needed after that. + +--- lib/private/Mail/Mailer.php 2024-08-29 15:55:02 ++++ lib/private/Mail/Mailer-new.php 2024-08-29 15:56:18 +@@ -131,17 +131,6 @@ + */ + public function createEMailTemplate(string $emailId, array $data = []): IEMailTemplate { + $class = $this->config->getSystemValueString('mail_template_class', ''); +- +- if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { +- return new $class( +- $this->defaults, +- $this->urlGenerator, +- $this->l10nFactory, +- $emailId, +- $data +- ); +- } +- + $logoDimensions = $this->config->getAppValue('theming', 'logoDimensions', self::DEFAULT_DIMENSIONS); + if (str_contains($logoDimensions, 'x')) { + [$width, $height] = explode('x', $logoDimensions); +@@ -165,6 +154,17 @@ + } + } else { + $logoWidth = $logoHeight = null; ++ } ++ if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { ++ return new $class( ++ $this->defaults, ++ $this->urlGenerator, ++ $this->l10nFactory, ++ $logoWidth, ++ $logoHeight, ++ $emailId, ++ $data ++ ); + } + + return new EMailTemplate( -- GitLab From 6762376224c3f3182e1d964e63d3ef89a4789a01 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 29 Aug 2024 16:28:46 +0530 Subject: [PATCH 2/8] added in docker --- Dockerfile | 1 + patches/037-mailer-template-fix.patch | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 55bd939..348e37b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -152,6 +152,7 @@ RUN patch -u ${BASE_DIR}/lib/private/Template/JSResourceLocator.php -i ${TMP_PAT RUN patch -u ${BASE_DIR}/lib/private/L10N/Factory.php -i ${TMP_PATCH_DIR}/032-select-lang-from-session.patch # UserConfigChangedEvent Ref: https://github.com/nextcloud/server/pull/42039 RUN cd ${BASE_DIR} && patch -p1 < ${TMP_PATCH_DIR}/036-user-config-change-event.patch +RUN patch -u ${BASE_DIR}/lib/private/Mail/Mailer.php -i ${TMP_PATCH_DIR}/037-mailer-template-fix.patch RUN rm -rf ${TMP_PATCH_DIR} # Custom theme diff --git a/patches/037-mailer-template-fix.patch b/patches/037-mailer-template-fix.patch index de98d91..4e5aa54 100644 --- a/patches/037-mailer-template-fix.patch +++ b/patches/037-mailer-template-fix.patch @@ -1,7 +1,6 @@ From: Avinash Date: Thu, 29 Aug 2024 15:50:00 +0530 -Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We also created the PR so may be if that got merge -This May not be needed after that. +Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We also created the PR so may be if that got merge then we need to delete this patch --- lib/private/Mail/Mailer.php 2024-08-29 15:55:02 +++ lib/private/Mail/Mailer-new.php 2024-08-29 15:56:18 -- GitLab From a94921e99101571782a939c1c62c2eeea7434808 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 29 Aug 2024 16:33:08 +0530 Subject: [PATCH 3/8] fix patch for mailer --- patches/037-mailer-template-fix.patch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/patches/037-mailer-template-fix.patch b/patches/037-mailer-template-fix.patch index 4e5aa54..8d88e17 100644 --- a/patches/037-mailer-template-fix.patch +++ b/patches/037-mailer-template-fix.patch @@ -27,16 +27,15 @@ Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We } else { $logoWidth = $logoHeight = null; + } -+ if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { ++ if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { + return new $class( + $this->defaults, + $this->urlGenerator, + $this->l10nFactory, -+ $logoWidth, -+ $logoHeight, ++ $logoWidth, ++ $logoHeight, + $emailId, + $data + ); } - return new EMailTemplate( -- GitLab From 0fa411074a8c37cc6fc04b5c959dedfea6f496fe Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 29 Aug 2024 16:54:27 +0530 Subject: [PATCH 4/8] patch modified --- Dockerfile | 2 ++ patches/037-mailer-template-fix.patch | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 348e37b..521ca2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -152,6 +152,8 @@ RUN patch -u ${BASE_DIR}/lib/private/Template/JSResourceLocator.php -i ${TMP_PAT RUN patch -u ${BASE_DIR}/lib/private/L10N/Factory.php -i ${TMP_PATCH_DIR}/032-select-lang-from-session.patch # UserConfigChangedEvent Ref: https://github.com/nextcloud/server/pull/42039 RUN cd ${BASE_DIR} && patch -p1 < ${TMP_PATCH_DIR}/036-user-config-change-event.patch + +# fixed Mailer.php error which is fixed in upstream,so we need to remove this in Nextcloud 29 upgrade RUN patch -u ${BASE_DIR}/lib/private/Mail/Mailer.php -i ${TMP_PATCH_DIR}/037-mailer-template-fix.patch RUN rm -rf ${TMP_PATCH_DIR} diff --git a/patches/037-mailer-template-fix.patch b/patches/037-mailer-template-fix.patch index 8d88e17..5dca9dd 100644 --- a/patches/037-mailer-template-fix.patch +++ b/patches/037-mailer-template-fix.patch @@ -1,13 +1,14 @@ From: Avinash Date: Thu, 29 Aug 2024 15:50:00 +0530 -Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We also created the PR so may be if that got merge then we need to delete this patch +Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .Already fixed on Stable 28,29 and 30. Not needed in next upgrade. --- lib/private/Mail/Mailer.php 2024-08-29 15:55:02 +++ lib/private/Mail/Mailer-new.php 2024-08-29 15:56:18 -@@ -131,17 +131,6 @@ +@@ -130,18 +130,6 @@ + * @since 12.0.0 */ public function createEMailTemplate(string $emailId, array $data = []): IEMailTemplate { - $class = $this->config->getSystemValueString('mail_template_class', ''); +- $class = $this->config->getSystemValueString('mail_template_class', ''); - - if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { - return new $class( @@ -22,11 +23,13 @@ Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We $logoDimensions = $this->config->getAppValue('theming', 'logoDimensions', self::DEFAULT_DIMENSIONS); if (str_contains($logoDimensions, 'x')) { [$width, $height] = explode('x', $logoDimensions); -@@ -165,6 +154,17 @@ +@@ -165,6 +153,19 @@ } } else { $logoWidth = $logoHeight = null; + } ++ ++ $class = $this->config->getSystemValueString('mail_template_class', ''); + if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { + return new $class( + $this->defaults, @@ -39,3 +42,5 @@ Subject: [PATCH] This actually fixes error introduces in 28.0.9 Mailer.php .We + ); } + return new EMailTemplate( + -- GitLab From 867bce3c5a970c46b70f83a6120c974798793df9 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 29 Aug 2024 18:07:38 +0530 Subject: [PATCH 5/8] remove the unneeded patch for custom app translations --- Dockerfile | 1 - patches/031-theme-custom-app-translations.patch | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 patches/031-theme-custom-app-translations.patch diff --git a/Dockerfile b/Dockerfile index 521ca2d..be040af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -148,7 +148,6 @@ RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-o RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/3rdparty/sabre/vobject/lib/ITip/Broker.php -i ${TMP_PATCH_DIR}/022-significantchange.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/026-primary-color-fix.patch -RUN patch -u ${BASE_DIR}/lib/private/Template/JSResourceLocator.php -i ${TMP_PATCH_DIR}/031-theme-custom-app-translations.patch RUN patch -u ${BASE_DIR}/lib/private/L10N/Factory.php -i ${TMP_PATCH_DIR}/032-select-lang-from-session.patch # UserConfigChangedEvent Ref: https://github.com/nextcloud/server/pull/42039 RUN cd ${BASE_DIR} && patch -p1 < ${TMP_PATCH_DIR}/036-user-config-change-event.patch diff --git a/patches/031-theme-custom-app-translations.patch b/patches/031-theme-custom-app-translations.patch deleted file mode 100644 index 7db4680..0000000 --- a/patches/031-theme-custom-app-translations.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ./lib/private/Template/JSResourceLocator.php 2024-03-15 19:15:38 -+++ ./lib/private/Template/JSResourceLocator-new.php 2024-03-15 19:16:54 -@@ -76,8 +76,12 @@ - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'core/'.$script); - $found += $this->appendScriptIfExist($this->serverroot, $script); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.$script); -- $found += $this->appendScriptIfExist($appRoot, $script, $appWebRoot); -- $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'apps/'.$script); -+ foreach (\OC::$APPSROOTS as $appRoot) { -+ $dirName = basename($appRoot['path']); -+ $rootPath = dirname($appRoot['path']); -+ $found += $this->appendIfExist($rootPath, $dirName.'/'.$script.'.js'); -+ $found += $this->appendIfExist($this->serverroot, $theme_dir.$dirName.'/'.$script.'.js'); -+ } - - if ($found) { - return; -- GitLab From 059b4e00b8b132053e2880e202d2ffa63f1faf4a Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 29 Aug 2024 23:57:07 +0530 Subject: [PATCH 6/8] Add fixed patch for custom app translations --- Dockerfile | 1 + .../031-theme-custom-app-translations.patch | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 patches/031-theme-custom-app-translations.patch diff --git a/Dockerfile b/Dockerfile index be040af..521ca2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -148,6 +148,7 @@ RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-o RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/3rdparty/sabre/vobject/lib/ITip/Broker.php -i ${TMP_PATCH_DIR}/022-significantchange.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/026-primary-color-fix.patch +RUN patch -u ${BASE_DIR}/lib/private/Template/JSResourceLocator.php -i ${TMP_PATCH_DIR}/031-theme-custom-app-translations.patch RUN patch -u ${BASE_DIR}/lib/private/L10N/Factory.php -i ${TMP_PATCH_DIR}/032-select-lang-from-session.patch # UserConfigChangedEvent Ref: https://github.com/nextcloud/server/pull/42039 RUN cd ${BASE_DIR} && patch -p1 < ${TMP_PATCH_DIR}/036-user-config-change-event.patch diff --git a/patches/031-theme-custom-app-translations.patch b/patches/031-theme-custom-app-translations.patch new file mode 100644 index 0000000..564d686 --- /dev/null +++ b/patches/031-theme-custom-app-translations.patch @@ -0,0 +1,19 @@ +--- JSResourceLocator.php 2024-08-29 22:10:30.588659044 +0530 ++++ JSResourceLocator-new.php 2024-08-29 23:55:00.239753244 +0530 +@@ -62,6 +62,7 @@ + // Handle symlinks + $appRoot = realpath($appRoot); + } ++ $appDirName = basename($appRoot); + // Get the app webroot + $appWebRoot = dirname($this->appManager->getAppWebPath($app)); + } catch (AppPathNotFoundException $e) { +@@ -77,7 +78,7 @@ + $found += $this->appendScriptIfExist($this->serverroot, $script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.$script); + $found += $this->appendScriptIfExist($appRoot, $script, $appWebRoot); +- $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'apps/'.$script); ++ $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.$appDirName.'/'.$script); + + if ($found) { + return; -- GitLab From 0ec3ff62a045165dfefc6a5873b54cdd793de2a2 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 29 Aug 2024 23:59:04 +0530 Subject: [PATCH 7/8] added back path for custom app translations patch --- patches/031-theme-custom-app-translations.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/031-theme-custom-app-translations.patch b/patches/031-theme-custom-app-translations.patch index 564d686..56f1433 100644 --- a/patches/031-theme-custom-app-translations.patch +++ b/patches/031-theme-custom-app-translations.patch @@ -1,5 +1,5 @@ ---- JSResourceLocator.php 2024-08-29 22:10:30.588659044 +0530 -+++ JSResourceLocator-new.php 2024-08-29 23:55:00.239753244 +0530 +--- ./lib/private/Template/JSResourceLocator.php 2024-08-29 22:10:30.588659044 +0530 ++++ ./lib/private/Template/JSResourceLocator-new.php 2024-08-29 23:55:00.239753244 +0530 @@ -62,6 +62,7 @@ // Handle symlinks $appRoot = realpath($appRoot); -- GitLab From 9aaedd339751d3668fe29f25e1ef2f4fcc33bf16 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 30 Aug 2024 15:09:04 +0530 Subject: [PATCH 8/8] Bump version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 521ca2d..da0380c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG USER_MIGRATION_JOB_ID="991454" ARG MEMORIES_VERSION="7.3.1" ARG DROP_ACCOUNT_VERSION="2.5.0" -RUN sed -i 's/28,0,9,1/28,0,9,3/' ${BASE_DIR}/version.php +RUN sed -i 's/28,0,9,1/28,0,9,4/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab