Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0cb07ef0 authored by Akhil's avatar Akhil 🙂
Browse files

Merge branch 'dev/nc-28-0-9-mailfix' into 'main'

fix mailer patch

See merge request !246
parents 03e907d9 cc42bf74
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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
@@ -152,6 +152,9 @@ 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}

# Custom theme
+13 −11
Original line number Diff line number Diff line
--- ./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);
--- ./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);
 			}
+			$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($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');	
+			}	
+			$found += $this->appendScriptIfExist($this->serverroot, $theme_dir.$appDirName.'/'.$script);
 
 			if ($found) {
 				return;
+46 −0
Original line number Diff line number Diff line
From: Avinash <avinash.gusain.ext@murena.com>
Date: Thu, 29 Aug 2024 15:50:00 +0530
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
@@ -130,18 +130,6 @@
 	 * @since 12.0.0
 	 */
 	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 +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,
+				$this->urlGenerator,
+				$this->l10nFactory,
+				$logoWidth,
+				$logoHeight,
+				$emailId,
+				$data
+			);
 		}
 
 		return new EMailTemplate(