Jump to content

Mike Rockett

Members
  • Posts

    1,452
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Mike Rockett

  1. Just a note to everyone, Jumplinks doesn't appear to be compatible with 3.0.3. I had it working on 3.0.1 and 3.0.2, but did not test with 3.0.3. In the meantime, I'm dropping the PW3 compatibility tag until I am 100% certain everything works. Scratch that. It is actually working. It was an error that appeared only once, and then disappeared. I believe it has something to do with namespacing or file compilation. Can't be sure as yet. So support for current devns is there, just prepare yourself for the odd warning or error here and there (though, I don't think there will be many).
  2. Strange... I've just tried the same, and got no errors or warnings. Let me check the schema quickly. Update: Schema appears to be correct. It first installs the tables, and then performs schema updates to those tables. last_hit is only added once. So, unable to reproduce here.
  3. Perhaps I chose this route as constructing anything manually got my brain in a twist. Sticking with this for now, but will attempt a reconstruction a little down the line. I do agree that it is the better way to go.
  4. There is this: http://modules.pw/ (Needs a little updating, however...)
  5. Have run a slightly larger test, and it seems to be okay - the methods appear to do the exact opposite thing, so it balances out. Thing is, it isn't done only via regex - by actually re-assigning trashed pages to their original parents, I'm able to get their full paths. So only working with the regex side of things won't actually get me anywhere... Unless I'm missing a good way to do that.
  6. I was using a recursive loop and then started trashing without saving before recursing, which gave me unexpected results. So now, its restore without saving, recurse, trash without saving. Haven't tested it on bigger nests in the trash - will do that now. Preferably, I'd like to rely on the method being used in the core. If it were to change, I don't want the module to break. Seemingly, this works at the moment. For reference, I'm doing this right now: // Let's see if the page was trashed if ($trash = $this->pages->get($this->config->trashPageID)) { $trashed = []; $listChildren = function ($page) use (&$trashed, &$listChildren) { // If not the trash page itself, restore the page without saving it // so we can get its actual path. // Then add its path and ID to the trashed pages array. if ($page->id !== $this->config->trashPageID) { $this->pages->restore($page, false); $trashed[] = [trim($page->path, '/'), $page->id]; } // Do the same for all its children if ($page->numChildren) { foreach ($page->children('include=all') as $child) { $listChildren($child); } } // Again, if not the trash page itself, then trash it without saving // to restore its original trashed state. if ($page->id !== $this->config->trashPageID) { $this->pages->trash($page, false); } }; $listChildren($trash); // Check to see if what we're requesting is actually in the trash. // if so, set the reason and break out. foreach ($trashed as $page) { if ($page[0] === $request->request) { $reason = self::ReasonPageTrashed; break; } } } Look okay?
  7. Magical. $pages->restore($page, false) does the trick. Needs PW 2.6.5, but I don't think that's a problem at all. Edit: Although, this seems to save the restored status, but leaves it in the trash...
  8. Yeah, that's the issue I'm facing. Guess I'll just have to work with that for now. In fact, I completely understand now why it's done this way. If I trash a page a page, then trash its parent, and then restore the first page, it keeps it in the trash, only underneath its parent. So will dig into the code to see exactly how to extract the information needed.
  9. I could be completely wrong here, but doesn't PW follow the IoC principal? So accessing wire(something) and $this->something (from a module) is calling the exact same thing? If that is the case, instantiating $pages is not necessary anyway.
  10. Mike Rockett

    404 Hits

    wp-admin is an actual directory, so it'll be domain.com/wp-admin/.
  11. I'm actually after something ever so slightly similar: need to check if a Page was trashed based on the request URI as part of the 404 monitor I'm building. I understand kixe had a problem with this - code is still commented out. It appears to be quite a mission, the way I see it, and so I wonder if there would be a possibility for Ryan to include the original path for each trashed Page. Or is there a simple method I can use that I'm just not seeing?
  12. Phew, okay. Did a hard reset back to the commit I wanted, and then re-branched dev - they're now in sync.
  13. Thought I'd seen that term somewhere. Thing is, Github Desktop no longer fast-forwards, it creates a new commit. I do prefer the fast-forward method, and believe was actually doing it with Git GUI. I take it there's no way I can revert this? (Btw: I see that a fast-forward cannot be achieved if master has diverged from dev in a separate commit. However, that doesn't seem to be the case for me. It was an issue at one point, but then I had everything synced up so there was no divergence.) (And forgive me; I'm not a git guru, so some things obviously baffle me... Getting to the point, however, where I just want to delete the repo and push a fresh one without history.)
  14. Git is starting to irritate me. Something changed when they release Github Desktop, which replaced the old Github for Windows. Before, I could simply merge the dev branch with master, and everything would sync up perfectly. Now, when I do it with Desktop, it creates a new commit called "Merge remote-tracking branch 'refs/remotes/origin/dev'", which means that the dev branch will always be one commit behind master. I made the mistake of merging master back to dev, and it's gone and added another commit, leaving master one commit behind dev. What on earth? Any way I can undo this mess? Delete dev and re-branch?
  15. Going to go ahead and implement this - I don't see any problems with it. If any come up, we can look at those when they do.
  16. Has anyone using Jumplinks experienced any issues with timestamps when using MySQL 5.7? I use MariaDB, and presently don't have access to MySQL 5.7, and so cannot test. As I understand it, strict mode is enabled by default in 5.7, and strict mode does not allow for zero-based timestamps. This issue came up in Laravel recently, and the solution was to use the previously disallowed NULL timestamps. On my end, with MariaDB 10.1.9, all appears to be working quite fine. For those running MySQL 5.7, please do let me know if you encounter any issues. If you do, we'll have to work on a schema update to figure out the best way to target all platforms. Edit: I see that 5.7.8 reverts changes to be compatible with 5.6 (strict mode on). As 5.7.9 is a general availability release, I don't really see this being a problem. For those that do experience issues, the best bet is to allow zero dates or turn strict mode off (whichever comes first - not entirely sure on how the config there would work).
  17. rockett.pw launched, with docs for Jumplinks. RockettForms will come soon, too. Getting there! :D

  18. Happy New Year to you, Ryan! Great post - certainly looking forward to the future of ProcessWire. Regarding the redesign of the website: I think a minor logo refresh may be in order. The idea of new branding has been brought up a few times, but I don't think a full refresh is in order - that would simply be to much of a change. This, however makes a lot more sense to me. Also, I guess that the site refresh would involve minimalism, and maybe a little 'boldness', but not too much. Not sure if I'll be able to make the time for it very soon, but will throw together a few concepts if I do.
  19. Haha! I must say though, it was partially unbearable - technically in a heat wave down here.
  20. Still a while away here in South Africa (and it's really hot here today, 31°C with almost zero wind), but just wanted to wish everyone a happy New year before I head off for celebrations. Hoping 2016 will be a prosperous year for all!
  21. Well, I don't actually think there should be an option for it - should just happen automatically, because requesting index.php/hello does not throw a 404 by default. So yes, if you were to request index.php/hello, Jumplinks would redirect it to /hello, which would then be redirected to /new-hello if a jumplink was registered for it.
  22. Actually giving this index.php thing a bit of extra thought. Sites that used such routing were simply not configured to use htaccess, which is default in PW anyway. Surely all index.php/* requests should be stripped of index.php? Right now, the module only redirects index.php with or without the trailing slash. Whereas, if I tell it to strip the index.php out of all requests, such as /index.php/hello -> /hello, then a 404 would be thrown if the resulting destination isn't found. To me, this makes more sense... Feedback? Edit: Also consider the fact that when you request index.php/hello, PW shows the home page... So no automatic 404 there anyway.
  23. Thanks guys. Yeah, figured I'd make use of the domain - at $2, it feels like a gift.
  24. I have gone ahead and add this to the dev branch. There's a new setting in the configuration called "Disable index.php matching", which you can enable to prevent these redirects. Please review before I merge with master as 1.5.1. Thanks.
  25. Hey Ivan, You are quite right about the previous discussion. Requests to /index.php/something will be seen as requests to the home page by processWire, unfortunately. As such, the only solution I have for this is to create a new setting in the module's configuration that tells Jumplinks to not redirect /index.php requests to the root and not redirect /index.php/* requests to /index.php.pwpj/*. Sound good to you?
×
×
  • Create New...