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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By stanoliver
      Hi! 
      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
      url_redirect|url 
      works just fine but when I try something similiar in the second code snippet
      $parent->url_redirect|url
      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
        wire()->log->message($page->name);
        $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?
    • By louisstephens
      So I have been diving into hooks lately, and I am enjoying them thus far. However, I guess I am a bit stumped on how to achieve what I want too. I am trying to set up a hook that would create a new child page when the parent page is saved. However, when you save the parent page a second time, I just need to update the child page without creating multiple child pages. What would be the best way to go about this?
      So after rereading my post, I believe it is a bit vague so I will try to explain more. 
      The Goal:
      Create a page with a template "one". Once the page is created/saved => create a new child page with the template of "two" If the parent is saved anytime after, do nothing to the child page (limit the parent page to one child page) The parent page is really just being used to output content, whereas the child page is being used to pull out the some fields from the parent to be used elsewhere. I might have made this too complicated in my head.
×
×
  • Create New...