[FEATURE] Fixing no unrendered text in preview 16/15616/1
authorBastian Bringenberg <mail@bastian-bringenberg.de>
Sun, 14 Oct 2012 19:03:08 +0000 (21:03 +0200)
committerBastian Bringenberg <mail@bastian-bringenberg.de>
Sun, 14 Oct 2012 19:03:08 +0000 (21:03 +0200)
Used a new variable for this.

Change-Id: I1a1d5ef14d2e63516c71fd62ff779bff69da05fa
Fixes: #41970 @0h10

Classes/Controller/PageController.php
Resources/Private/Templates/Page/Edit.html

index b10ed90..d621f6f 100755 (executable)
@@ -124,12 +124,16 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
                        $persistenceManager->persistAll();
                }
         $preview = NULL;
+        $myUnrenderedText = '';
+        if($page->getMainRevision() !== NULL) $myUnrenderedText = $page->getMainRevision()->getUnrenderedText();
         if($unrenderedText !== NULL){
             $renderHelper = $this->createRenderHelper();
             $preview = $renderHelper->renderText($unrenderedText);
+            $myUnrenderedText = $unrenderedText;
         }
         $this->view->assign('preview', $preview);
                $this->view->assign('page', $page);
+        $this->view->assign('unrenderedText', $myUnrenderedText);
        }
 
        /**
index 14e32ae..ca43e3d 100755 (executable)
@@ -8,7 +8,7 @@
     </f:if>
     <h2>{page.pageTitle}</h2>
     <f:form action="update" arguments="{page:page}">
-        <f:form.textarea cols="20" rows="5" name="text" value="{page.mainRevision.unrenderedText}" />
+        <f:form.textarea cols="20" rows="5" name="text" value="{unrenderedText}" />
         <f:form.submit name="command" value="Save" />
         <f:form.submit name="preview" value="Preview" />
     </f:form>