[GH-ISSUE #249] Default Quota not populated when mailbox is created #201

Closed
opened 2026-02-26 09:36:40 +03:00 by kerem · 1 comment
Owner

Originally created by @maysara on GitHub (Aug 1, 2018).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/249

It seems that the quota defined for domain is not being populated correctly in the mailbox form (shows up always as 0), I guess this has been reported earlier in various issues, last thing I found somehow relevant was #38 , the below change fixed it for me ... but I'm not sure if this is indeed the correct change.

 +++ application/controllers/MailboxController.php        2018-08-01 21:56:44.474502379 +0200
 @@ -206,7 +206,7 @@
                 $form->removeElement( 'domain'     );
             }
             else
 -                $form->getElement( "quota"  )->setValue( 0 );
 +                $form->getElement( "quota"  )->setValue( $this->getDomain()->getQuota() );

             $this->view->form = $this->mailboxForm = $form;
Originally created by @maysara on GitHub (Aug 1, 2018). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/249 It seems that the quota defined for domain is not being populated correctly in the mailbox form (shows up always as 0), I guess this has been reported earlier in various issues, last thing I found somehow relevant was #38 , the below change fixed it for me ... but I'm not sure if this is indeed the correct change. ``` +++ application/controllers/MailboxController.php 2018-08-01 21:56:44.474502379 +0200 @@ -206,7 +206,7 @@ $form->removeElement( 'domain' ); } else - $form->getElement( "quota" )->setValue( 0 ); + $form->getElement( "quota" )->setValue( $this->getDomain()->getQuota() ); $this->view->form = $this->mailboxForm = $form; ```
kerem closed this issue 2026-02-26 09:36:40 +03:00
Author
Owner

@maysara commented on GitHub (Aug 2, 2018):

The patch above breaks the addition of mailboxes without the context of the domain; below is a second attempt that tries to handle both situations (add from domain or add directly from mailboxes):

--- a/application/controllers/MailboxController.php 2018-06-12 15:23:00.841195033 +0200
+++ b/application/controllers/MailboxController.php        2018-08-02 16:13:14.649628883 +0200
@@ -205,6 +205,8 @@
                 $form->removeElement( 'local_part' );
                 $form->removeElement( 'domain'     );
             }
+            elseif( $this->getDomain() )
+                $form->getElement( "quota"  )->setValue( $this->getDomain()->getQuota() );
             else
                 $form->getElement( "quota"  )->setValue( 0 );

<!-- gh-comment-id:409941807 --> @maysara commented on GitHub (Aug 2, 2018): The patch above breaks the addition of mailboxes without the context of the domain; below is a second attempt that tries to handle both situations (add from domain or add directly from mailboxes): ``` --- a/application/controllers/MailboxController.php 2018-06-12 15:23:00.841195033 +0200 +++ b/application/controllers/MailboxController.php 2018-08-02 16:13:14.649628883 +0200 @@ -205,6 +205,8 @@ $form->removeElement( 'local_part' ); $form->removeElement( 'domain' ); } + elseif( $this->getDomain() ) + $form->getElement( "quota" )->setValue( $this->getDomain()->getQuota() ); else $form->getElement( "quota" )->setValue( 0 ); ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#201
No description provided.