Jump to content

Mike Rockett

Members
  • Content Count

    1,398
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by Mike Rockett


  1. @adrian Interesting point indeed, though I recall having changed the priority once or twice in the past for some reason or the other. To me, it makes sense that JL does its thing first as it acts as a user-intervention strategy in that we have to honour the user's wishes. Figuring out what those are, however, is a different story, given the different approaches/modules that are available. I wish this could be configured by the user, in the case conflicts/undesired redirects take place. Jumplinks was actually borne from a plugin I wrote for Bolt CMF, and that plugin was an absolute, undeniable 'before everything else even considers thinking of tunning running' scenario. Before we make a decision here, I think we should get more feedback from other JL users, and perhaps get a list together of any plugin that does route-redirection along with their priorities.

    • Like 1

  2. @nabo - Thanks for letting me know. I see I updated composer.json and not info.json as well.

    Update: I have made the change in the repo, but will only be able to update the module directory when I find the password.

    • Like 1

  3. @baronmunchowsen – I think mapping collections might be what you need if you haven't declared them in the correct order. Create a collection called blog, and include only the one you would like before the catch-all takes effect. So add old-url=new-url in the collection. Then your source would be blog/{all} and your destination would be new-blog/{all|blog}. That should do it, hopefully.

    As for query strings, that's being added to v2, which is on hold again unfortunately.


  4. @phlp The reason the cell is empty is because the parser could not determine the browser name and version, and so it's empty anyway. At best, I could simply indicate that the that browser is "unknown" in that column. Wouldn't want to not store unknown agents just because they can't be parsed - this would be getting rid of raw information that might be useful to some folks.


  5. @OllieMackJames Okay, well I honestly don't think there's much more I can do here (unless I'm missing something staring at me in the face 🙈). Hoping to find time soon to continue work on v2 (starting writing the frontend a little while back), which will keep track of these things a little differently (a migration table). 

    8 hours ago, OllieMackJames said:

    been using this great module for years already, thanks

    Scary to think how long it's been around, and how long I've taken to get v2 anywhere 🙃

    • Like 1

  6. @OllieMackJames - hmm, something weird is going on here as this is not the first time this has come up (I don't think)... I wonder if it's something related to the module config. The schema version is set there, and it will iterate through the schema updates until it matches the current version. That particular column is way back in schema v3, which is why I think there might be a config issue going on here... Was this a new install or an upgrade?

    • Like 1

  7. 1 hour ago, d'Hinnisdaël said:

    Just gave it a try — works like a charm! Thanks for merging so quickly.

    A thought on the hook name: would it make more sense to call it getAdditionalPageUrls (including "urls") to clarify it's returning additional URLs for a specific page? One might need a hook at some point to get additional pages independent of any other page (who knows why), which would then appropriately be called getAdditionalPages.

    Great stuff - and does the language support hook-setup work as expected?

    You're quite right indeed, will sort that out some time tomorrow. 🙂


  8. 3 minutes ago, Mike Rockett said:

    That aside though, surely I can add the hooks directly in ___getAdditionalPages?

    I actually see I did that already 😅So feel free to leave out the static method call above and let me know if it works.

    • Like 2

  9. So I've been a bit busy this morning refactoring and brooming. A man is busy of late, but hey, gotta make some time for these things eventually.

    Anyways, couple of things I've done so far:

    1. Updated the underlying sitemap package.
    2. Refactor: split some code out into concerns, added support helpers, added return types and fixed up doc blocks.
    3. Dropped support for PW 2.8 and PHP < 7.1 (should be 7.2, but fine for now)
    4. Manually pulled in the merge request with an additional static method to add the language support hooks. I don't really have a good test case to work with, but this is the idea:
    use MarkupSitemap;
    
    wire()->addHookAfter(MarkupSitemap::getAdditionalPages, function ($event) {
      $page = $event->arguments(0);
      $language = $event->arguments(1);
    
      MarkupSitemap::applyLanguageSupportHooks();
    
      // Add additional pages
    });

    It should internally track whether or not they've been added, but I've simply not tested it yet, so can't say for sure. 😅That aside though, surely I can add the hooks directly in ___getAdditionalPages?

    If you'd like to give it a spin, please check out the develop branch directly.

    • Like 2

  10. Thanks so much @d'Hinnisdaël, really appreciate the effort here 🙂 Will review, test and merge this morning. Regarding videos, you might actually want to hold off on that for a bit, as I'd first like to add the additional sub-element class for it, and perhaps a few others as well. The Sitemap class itself comes from ThePixelDeveloper over at GitHub, and so I think I might want to upgrade that instead, to utilise the newer features / code-base.


  11. @adrian – I'd be happy to. I see from a previous discussion with Teppo that the priority was set due to a conflict with sitemaps. That being said, I do believe there is a measure in place to circumvent sitemap.xml URIs from being logged, so as a result, I don't see why we can't change the hook and priority. At the end of the day, it kinda makes sense. Modules that need to do things with 404 events should be given the opportunity to do so before JL comes in as a last resort. So I'm going to go ahead and do this – if anyone encounters any issues, we'll need to deal with them on an as-and-when basis.

    • Like 1

  12. Hi guys,

    Super sorry for not getting back to you – much like @kongondo, royally swamped (this time of year).

    First off, I'm battling to understand why folks are having install/upgrade troubles here. Whilst JL1 doesn't use a full-on DB migration strategy, it does have an iterative cycle. If you're on schema v4 and upgrade to the latest version, it should be doing v5 and then v6. Only thing I can think of then is that the schema version got messed up somehow. It gets saved in the module’s config, so I really don't see what could have messed it up (I recently formatted those files, but naturally that should not make a difference). I'd need to try reproduce this to see what might be going on. As an aside, JL2 will use DB migrations, so this issue would less likely be encountered unless the applicable tracking table was truncated. Hoping to get JL2 wrapped up over the holidays (lots of leave-days, no big plans).

    @adrian – I see PagePathHistory doesn't set its own priority, and JL does. I recall doing this for a reason, but given what you've said, perhaps JL should be somehow setup to be the 'last resort'?

    @teppo – Given the schema errors that are being experienced, I think that for the time being, I'm going to simply truncate the string that gets stored to 512 characters. Also a little confused by the 404 logger – it really should not be doing anything if turned off. I do see that it only logs the 404 if there are no jumplinks – I'll definitely fix up that part. 

    Update: I've pushed out 1.5.58 - please let me know if the DB errors stop. Thanks!

     

    • Like 1

  13. Hey @teppo and @d'Hinnisdaël – both very good ideas indeed. I'm happy to implement both hooks, the only problem is that this time of year is super busy for me, so I won't be able to get to it straight away. If it's something you're looking for in the immediate-term, please feel free to pop me a merge request or two. In the meantime, I'll open up an issue on the repo. 🙂

    • Like 2

  14. 3 minutes ago, adrian said:

    You're a legend - thank you - works perfectly!

    You're welcome. JL2 (when I get there 🙈) will give some more control here. This case would be covered by subscribe/{path} --> @[1495]/{path}, and then there'd either be a {query} wildcard or an option on the jumplink itself to automatically carry it over.

    • Like 1

  15. 3 minutes ago, adrian said:

    Thanks @Mike Rockett - the {!all} does the trick, but thanks for looking into updating the cleaner!

    Thanks for the superfast response!

    Any time 🙂 I've rolled out 1.5.57 with a fix, so you should be good to go without the {!all}, which is somewhat unsafe IMO.

    • Like 1

  16. @adrian Ok so this seems to be the wildcard cleaner. Because {all} is the equivalent of .*, it includes the query string in this case and therefore cleans it like a normal wildcard. The only option for the time being is to disable cleaning of {all}, by changing it to {!all} in the destination. I know it's not perfect, but JL doesn't actually handle query strings very well – they should actually be handled separately somehow.

    Edit: I'm actually going to see if I can update the cleaner to prevent query string character cleaning.

    • Like 1

  17. 4 minutes ago, adrian said:

    Source: subscribe/{all}
    Destination: [[1495]]{all}

    Ah of course - didn't click that it would be the same as the previous query 🙈 😆

    Ok I'm able to reproduce, will investigate

    • Like 1

  18. 3 minutes ago, adrian said:

    Thanks very much - let me know if you have any trouble reproducing.

    Going to have to spin this up and see what's going on. Mind sharing your source/destination with me?

    Just now, adrian said:

    I just removed all those calls and it doesn't seem to be coming from them as it didn't help.

    Sorry, I edited that post as you were replying

    • Like 1
×
×
  • Create New...