View Issue Details

IDProjectCategoryView StatusLast Update
0000132BwPostmanNewsletters Backendpublic2020-06-09 15:44
Reporterdstreichert Assigned ToRomana  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.3 
Summary0000132: If the template to be used has a tpl_id = 0 and a paper_bg is stored in the database, then the wrong body tag is used.
DescriptionIf the template to be used has a tpl_id = 0 and a paper_bg is stored in the database, then the wrong body tag is used.
But again I have worked out a solution in version 2.3.1 that I would like to suggest here.
I have attached a diff file to patch the file "/administrator/components/com_bwpostman/helpers/contentRenderer.php" in version 2.3.1.
TagsNo tags attached.

Activities

dstreichert

2020-03-16 11:31

reporter  

contentRenderer.php.diff (1,553 bytes)   
--- contentRenderer.orig.php	2020-03-15 18:31:44.740774065 +0100
+++ contentRenderer.php	2020-03-16 11:07:46.276655997 +0100
@@ -950,13 +950,24 @@
 
 		$newtext .= '   </style>' . "\n";
 		$newtext .= ' </head>' . "\n";
 
-		if (isset($tpl->basics['paper_bg']))
+		if ($tpl->tpl_id !== '0')
 		{
-			$newtext .= ' <body bgcolor="' . $tpl->basics['paper_bg'] .
-				'" emb-default-bgcolor="' . $tpl->basics['paper_bg'] . '" style="background-color:' . $tpl->basics['paper_bg'] .
-				';color:' . $tpl->basics['legal_color'] . ';">' . "\n";
+                    $newtext .= ' <body ';
+                    if (empty($tpl->basics['paper_bg'])) {
+			$newtext .= 'bgcolor="#ffffff" emb-default-bgcolor="#ffffff"';
+                        if(!empty($tpl->basics['legal_color'])) {
+                            $newtext .= ' style="color:' . $tpl->basics['legal_color'] . '";';
+                        }
+                    } else {
+			$newtext .= 'bgcolor="' . $tpl->basics['paper_bg'] . '" emb-default-bgcolor="' . $tpl->basics['paper_bg'] . '" style="background-color:' . $tpl->basics['paper_bg'] . ';';
+                        if (!empty($tpl->basics['legal_color'])) {
+                            $newtext .= 'color:' . $tpl->basics['legal_color'] . ';';
+                        }
+                        $newtext .= '"';
+                    }
+                    $newtext .= '>' . "\n";
 		}
 		else
 		{
 			$newtext .= isset($tpl->tpl_tags_body) && $tpl->tpl_tags_body == 0 ? $tpl->tpl_tags_body_advanced : BwPostmanTplHelper::getBodyTag();
contentRenderer.php.diff (1,553 bytes)   

Romana

2020-06-09 09:34

administrator   ~0000053

Last edited: 2020-06-09 09:50

View 2 revisions

Description and code mismatches! Wrong body tag is mentioned, if tpl_id = 0, but code changes only meets tpl_id != 0. tpl_id is != 0, if a predefined template is used, tpl_id = 0 meets all self created freestyle templates.

There is no setting for paper_bg at the freestyle templates (tpl_id = 0), this setting only is in place for predefined templates. If one want to set "paper_bg" for freestyle templates, then the body tag at the tab expert settings has to be set correctly.

Issue History

Date Modified Username Field Change
2020-03-16 11:31 dstreichert New Issue
2020-03-16 11:31 dstreichert File Added: contentRenderer.php.diff
2020-04-15 07:40 Romana Assigned To => Karl
2020-04-15 07:40 Romana Status new => assigned
2020-06-09 08:31 Romana Assigned To Karl => Romana
2020-06-09 09:34 Romana Note Added: 0000053
2020-06-09 09:35 Romana Severity major => minor
2020-06-09 09:35 Romana Status assigned => feedback
2020-06-09 09:50 Romana Note Edited: 0000053 View Revisions
2020-06-09 15:44 Romana Status feedback => resolved
2020-06-09 15:44 Romana Resolution open => no change required