Jump to content
Mike Rockett

Save actions redirecting to home page

Recommended Posts

Hi all :)

Seems I've bumped into an issue where, if I save a page or update a module, I'm redirected back to the home page (frontend).

I was using 2.5.23-dev, and thought that an update to 2.5.27-dev would fix it, but no luck. No errors showing up in any logs either.

The following modules are installed on the site:

  1. AIOM
  2. Diagnostics
  3. Map Marker
  4. Data Tables
  5. Maintenance Mode
  6. SEO
  7. Modules Manager
  8. Jumplinks
  9. Upgrades
  10. Template Notes

Upon inspection, module/download/ is sending a 302 redirect to /.

Interestingly, the inspector says that the following form data was sent to module/download/:

  1. godownload:
    Download and Update (0.0.4)

which is the text for the button (was trying to upgrade the Upgrades module).

I assume that is the problem?

Update: This doesn't happen with every page, however. If I save the home page, I get redirected back to the home page. If I save the "certification" page, I get redirected to the home page. If I save the "donate" page, however, then it saves and reloads.

Edited by Mike Anthony
  • Like 1

Share this post

Link to post
Share on other sites

Okay, so I've just downloaded the installation from the production server to see if the same thing would happen locally. It doesn't.

I can't really figure out what's wrong here. The file and folder permissions are set properly, and everything was working about a month ago.

Any clues?

Share this post

Link to post
Share on other sites

i would say maybe try disabling the upgrades and/or upgrade check module, then also check with the host and see if they have any security rules that your ip is triggering?

Share this post

Link to post
Share on other sites

Mmm, it seems it's working now, with no intervention on my end. Module upgrades are not working (even after manually upgrading ProcessWireUpgrade), but saving pages is working. The form data being sent (as mentioned before) is actually correct (surprisingly), as it works locally.

I'm going to try a few things, such as re-installing the site on the server (via FTP, usual method) or, if that doesn't work, I'll do a profile export to a fresh installation. If all fails, then I'll get in touch with my host.

By far, this is the weirdest thing to have happened to me... I'm almost convinced that it isn't a PW problem.

Share this post

Link to post
Share on other sites

So my host doesn't know what's going on, and I have done a fresh install, the same way I do it for my other sites with the same host.

The only way I could update modules was by going to New and entering the class name.

Side note: Also been having issues today trying to upgrade a site to 2.6, and it seems the server that the site lives on is quite popular, and so the download breaks. Definitely thinking about changing hosts.

Share this post

Link to post
Share on other sites

It appears that this is now happening on another site as well.
If I try to update a module, the browser navigates to admin/module/download/ and the home page is displayed.
Request Header:

POST /admin/module/download/ HTTP/1.1
Host: <redacted>
Connection: keep-alive
Content-Length: 103
Pragma: no-cache
Cache-Control: no-cache
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://<redacted>
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2358.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded
DNT: 1
Referer: http://<redacted>/admin/module/?update=VersionControl
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Cookie: WireTabs=tab_new_modules; modules_section1=; modules_section2=; modules_section3=; modules_section4=; wire=3ddcf3e516910183700aed4d8dd7d5e8; wire_challenge=lKTmEV1SH83NgceBpBytCpSOUKuitA8Q 

Response Header:

HTTP/1.1 404 Page Not Found
Date: Wed, 24 Jun 2015 14:10:52 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
X-XSS-Protection: 1; mode=block
Content-Length: 1868
Keep-Alive: timeout=5, max=95
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8 

What could be causing this? It's really so unusual...

Share this post

Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By stanoliver
      The following code snippet is part of my markup simple navigation and the url_redirect (url field in the backend) just works fine when I put an special custom url into the url_redirect field.
      <?php $nav = $modules->get("MarkupSimpleNavigation"); // topnav $current = $page->rootParent(); // current root page // subnav echo $nav->render(array( 'max_levels' => 2, 'item_tpl' => '<h4><a class="g8-bar-item g8-hover-black" href="{url_redirect|url}">{title}</a></h4><hr class="sidenav">', 'collapsed' => true, ), $page, $current); ?>  In my seperated breadcrumb navigation I use the following code snippet
      <?php foreach($page->parents()->append($page) as $parent) { echo "<li><a href='{$parent->url_redirect|url}'>{$parent->title}</a></li>"; } ?> Now to the problem: In my first code snippet above the
      works just fine but when I try something similiar in the second code snippet
      I produce an server error How do I have to change the second code snippet so that it works in the correct way as the first code snippet does?
    • By Tyssen
      I have a page that contains a single ProFields table field and I want to display the contents of the table on the front end and then for logged in users, they can edit certain columns in the table.
      What I have at the moment is
      $out = '<form action="'.$page->url.'" method="post" > <table class="table"> <tbody>'; $count = 1; foreach($page->fieldName as $row) : $out .= ' <tr> <td><input type="checkbox" name="fieldName_'.$count.'_columnName"></td> </tr>'; if($input->post->submit) : $page->of(false); $page->set('fieldName_'.$count.'_columnName', $sanitizer->text($input->post->{fieldName_'.$count.'_columnName})); $page->save(); endif; $count++; endforeach; $out .= ' </tbody> </table> <button class="button" type="submit">Save</button> </form>'; The two problems I have are:
      I get an error trying from $sanitizer->text($input->post->{fieldName_'.$count.'_columnName}), not sure how to make that dynamic.  If I change the above to just a static value, e.g. $page->set('fieldName_1_columnName', 'Testing') and save the form, it's not saving the values to the database. Where am I going wrong?
    • By VeiJari
      Hello forum!
      I've yet again stumbled on a head-scratching situation. We have enabled the option on our articles template and events template that it skips the title adding part and goes straight to the form. This is what our customer wants. So when you add a new article or event it automatically names it temporary to "article-0000000" and same with event. Now the problem is that obviously after saving the form we want to change to page url or "name" to the title, like it's normally. 
      Now here's the code for the hook:
      wire()->addHookBefore("Pages::saved(template=tapahtuma|artikkeli)", function($hook) {
        $page = $hook->arguments(0);
        $newUrl = wire()->sanitizer->pageName($page->title); // give it a name used in the url for the page
        $page->setAndSave('name', $newUrl);
      I get the correct page and the name and path changes when I log them, but when I try to save it. It just loads and then I get: 
      Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) This happens in sanitizer.php
      and then another error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
      What is happening? Am I not suppose to use sanitizer in this way? When we made a temporary page object in out other hook, the sanitizer worked perfectly.
      Thanks for the help!
    • By Orkun
      Hi Guys
      How can I make a redirect inside the .htaccess to my custom maintenance.html file when any URL of my Website is accessed except the processwire admin (www.example.com/processwire/).
      Because I want that my User's still can access the website when they are loggedin in Processwire.
      When the current url starts with /processwire or if there is a processwire-login-cookie (Is there a cookie when user is logged in Processwire?) available the redirect should not work. Otherwise it should work.
      How can I achieve this?
  • Create New...