Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix bug in message handling. FlashMessenger content was not available…

… until the subsequent page load. Add auth messages to the view directly takes care of it.
  • Loading branch information...
commit da2507df114ec3a632e64410e5cc8df5679d28b6 1 parent 359cb0e
Jeremiah Small authored March 09, 2013
24  module/Application/src/Application/Controller/LoginController.php
@@ -27,13 +27,13 @@ public function indexAction()
27 27
         $result = $adapter->setLayoutname('Project')->execute();
28 28
         
29 29
         if ($result['error'] === 0){
30  
-            $messages = $adapter->getDbname() . ' is hosted on ' . $adapter->getHostname() . '.';
  30
+            $installMessages = $adapter->getDbname() . ' is hosted on ' . $adapter->getHostname() . '.';
31 31
             $serverIsOnline = TRUE;
32 32
         } else {
33  
-            $messages[] = 'Error Type: '  . $result['errortype'];
34  
-            $messages[] = 'Error Code: '  . $result['error'];
35  
-            $messages[] = 'Error Text: '  . $result['errortext'];
36  
-            $messages[] = 'Adapter URL: ' . $result['url'];
  33
+            $installMessages[] = 'Error Type: '  . $result['errortype'];
  34
+            $installMessages[] = 'Error Code: '  . $result['error'];
  35
+            $installMessages[] = 'Error Text: '  . $result['errortext'];
  36
+            $installMessages[] = 'Adapter URL: ' . $result['url'];
37 37
             $serverIsOnline = FALSE;
38 38
         }
39 39
         
@@ -44,7 +44,8 @@ public function indexAction()
44 44
             return $this->redirect()->toRoute('home');
45 45
         }
46 46
         
47  
-        $form       = $this->getForm();
  47
+        $form        = $this->getForm();
  48
+        $messages = array();
48 49
         
49 50
         $request = $this->getRequest();
50 51
         
@@ -63,8 +64,9 @@ public function indexAction()
63 64
                  
64 65
                 foreach($result->getMessages() as $message)
65 66
                 {
66  
-                    //save message temporary into flashmessenger
  67
+                    //save messages into view messages and flashmessenger
67 68
                     if (is_string($message)){
  69
+                        $messages[] = $message;
68 70
                         $this->flashmessenger()->addMessage($message);
69 71
                     }
70 72
                 }
@@ -85,10 +87,10 @@ public function indexAction()
85 87
         }
86 88
         
87 89
         return array(
88  
-                'form'      => $this->getForm(),
89  
-                'messages'  => $this->flashmessenger()->getMessages(),
90  
-                'installMessages' => $messages, 
91  
-                'serverIsOnline' => $serverIsOnline,
  90
+                'form'            => $form,
  91
+                'messages'        => $messages,
  92
+                'installMessages' => $installMessages, 
  93
+                'serverIsOnline'  => $serverIsOnline,
92 94
         );
93 95
         
94 96
     }

0 notes on commit da2507d

Please sign in to comment.
Something went wrong with that request. Please try again.