Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/23/2025 in Posts

  1. Just a heads up for everyone to be careful with this upgrade. I had a poor piece of code that worked before but broke with these markup region changes. In my _main.php I had: <div id="main"> and in my templates I was doing: <main pw-replace id="main"> So before, the id="main" was enough to match - now it no longer matches. Obviously a mistake on my part - I have now replaced "<div" with "<main" in _main.php and everything works again.
    3 points
  2. You can apply any SQL you want by hooking into the PageFinder: $wire->addHookAfter("PageFinder::getQuery", function (HookEvent $event) { // get the DatabaseQuerySelect object $query = $event->return; // dump the object to tracy // https://i.imgur.com/BdDEQU3.png bdb($query); // modify the query to only find pages with name length < 5 $query->where("LENGTH(pages.name)<5"); // remove the hook after first execution $event->removeHook(null); }); bd($pages->find("id>0")); The idea is to add the hook directly above your $pages->find() call and inside the hook you remove it so that it does not apply to any other $pages->find() operations that might occur later. This is a DatabaseQuerySelect object: And with that object you can add any custom ->where() or ->join() or whatever you need.
    2 points
  3. Maybe not useful for everyone, but I find I am often searching for content via Adminer and when the results are from a repeater item page, I need to figure out which is its "forPage". I have just added a new forPage row to the PageInfo section of the RequestInfo panel that lets you view or edit directly from here making things much easier.
    1 point
  4. And https://processwire.com/store/form-builder/ has a stripe integration as far as I know
    1 point
  5. What exactly is your question? There are actually multiple ecommerce modules available these days: https://www.baumrock.com/en/processwire/modules/rockcommerce/ https://processwire.com/talk/topic/31317-introducing-processwire-commerce/
    1 point
  6. @snck The purpose of the requests on the config page are to confirm that your API key works by making an API request to get the available languages. The only time that it will make 4 API calls on the config page is when you are first entering your API credentials. After you have entered valid credentials it will only make 2 API calls when you load the module config page. This hasn't ever been an issue before so I'm very curious why you are seeing a 429 but others haven't. Here's some additional details on why you are seeing 2 or 4 API calls for languages in Fluency when using DeepL: Fluency needs to know what languages a service allows you to translate from and what languages you can translate to. Google Cloud Translate will give you this information in 1 API call. DeepL requires you to make two API calls, one for source languages and one for target languages. Fluency is built with a modular architecture so that new translation services can be added easily. If you're interested you can compare DeepLEngine.php with GoogleCloudTranslationEngine.php. Each have the same methods that return the same data type but how it gets that data is entirely internal. To see what I mean about the 2 API calls vs 1 API call compare the getLanguages() method in each of those. 2 API calls is technically just one execution of the getLanguages() function. You should only see 4 API calls when: You first enter your API credentials and hit save You change translation engines You entered incorrect credentials and have to re-enter them After that it should only be 2 when using DeepL in Fluency. Back to your issue- 4 API calls shouldn't cause a 429. The DeepL team states that API calls should be limited to 50 requests per second. That comment is in an issue in their Node library, but the limits should still apply for all API usage. I just removed my credentials and re-added them without any issues. Are you seeing 4 API calls every time you load or save the module config page? I have to ask the obligatory security question- is there any chance that your credentials are being used by someone else or were compromised? I know that you said that you just created your API key today but you would have to be absolutely hammering the DeepL API to get a 429. I've never seen it during regular usage and it hasn't come up here in the forums by anyone who has been using the module for years. This is a tough issue to crack especially since it's happening for you but not me at the same time. Let me know if there's any additional info you can share.
    1 point
×
×
  • Create New...