Jump to content

GET param modal not preserved after adding new page


teppo
 Share

Recommended Posts

This may have been discussed already in the AdminBar thread, but I simply couldn't find it there. Problem seems to be that buildForm method of ProcessPageEdit preserves GET parameter modal by default, while it's otherwise similar cousin in ProcessPageAdd doesn't.

I'm just wondering if it would be possible to make these two methods work the same way in this little detail - unless, of course, there's actually a logical reason for this minor inconsistency? :)

Edit: Went ahead and checked what kind of changes this would require. Seems to me that these would be enough:

@@ -160,7 +160,7 @@
               $form = $this->modules->get('InputfieldForm');

               $form->attr('id', 'ProcessPageAdd');
-                $form->attr('action', './');
+                $form->attr('action', './' . ($this->input->get->modal ? "?modal=1" : ''));
               $form->attr('method', 'post');

               if(is_null($this->template) || !$this->template->noGlobal) {
@@ -309,7 +309,7 @@
               $this->pages->save($this->page);

               $this->session->message(sprintf($this->_('Created page %1$s using template: %2$s'), $this->parent->url . $this->page->name, $template->name));
-                $this->session->redirect("../edit/?id={$this->page->id}");
+                $this->session->redirect("../edit/?id={$this->page->id}" . ($this->input->get->modal ? "&modal=1" : ''));
       }
Edited by teppo
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...