Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. If you have a look at the RockFrontend Site Profile you'll see that it should work without namespaces: https://github.com/baumrock/site-rockfrontend/blob/3c6dcc3d6a73432f4a98f5d47bec9858fa1fbd23/templates/sections/footer.latte#L17 https://github.com/baumrock/site-rockfrontend/blob/3c6dcc3d6a73432f4a98f5d47bec9858fa1fbd23/classes/HomePage.php#L27 I have no idea why the syntax you mention would work. I've never seen adding a namespace on the method call of an object 😮
  3. I do love Latte, but one little thing is puzzling me at the moment: namespaces. I am using custom page classes for all my 'business logic' - e.g a method getEmailHash() in the custom page class called in the Latte script with $page->getEmailHash(). The class has the namespace ProcessWire. It seems that I always need to specify the namespace in the method - i.e. $page->ProcessWire\getEmailHash(). Is there a way of avoiding this?
  4. There are several modules that might help. Most by Macrura here in the forums.
  5. You can use https://processwire.com/modules/fieldtype-runtime-markup/ for that.
  6. Today
  7. Hi all! Is there a way to add comments and documentation directly in the admin area, e.g. above the page editor? Field descriptions and notes are not sufficient in some cases, when one wants to document more complex things or explain something more detailed. I know that one can add a custom admin page, but I am searching for a way to document things directly in the pages where the editor users are working. Thanks in advance for any tips!
  8. Depending on your requirements, the Stripe payment processor for FormBuilder might be worth investigating. You can set Paypal to be a payment option in Stripe so that users can pay using PayPal but you can keep all your transactions on the same plaform. Out of the box FormBuilder might not do everything you need (if you need a basket etc) but it is possible to hook into the module to update line items / prices etc. We recently built a basket system for a site that we'd wired directly into Stripe but then shifted over to hook into Formbuilder instead because it already did a lot of the heavy lifting in using the Stripe API.
  9. I've only just spotted this but, in my ddev environment, if I modified a page the modified date was always recorded as one hour earlier. So appears on the settings tab immediately after doing a modification (at 14:55). The production environment was OK. I have $config->timezone = 'Europe/London'; throughout in config.php. It seems that you also need to set the timezone (in my case 'timezone: Europe/London') in the ddev config.yaml
  10. Maybe open an issue in the issue tracker if not yet done?
  11. Hi, I post here before to report an issue, just in case I'm missing something (using PW 3.0.229). To create instances of a custom page class, I'm adding a static method on it: class IndividualCarChoicePage extends Page { public static function create(UserPage $user, ChampionshipPage $championship): void { $carChoiceParent = wire()->pages->get("parent_id=$championship->id, template=" . ProcesswireTemplate::INDIVIDUAL_CAR_CHOICES); $carChoicePage = new IndividualCarChoicePage(); $carChoicePage->of(false); $carChoicePage->template = ProcesswireTemplate::INDIVIDUAL_CAR_CHOICE; $carChoicePage->parent = $carChoiceParent; $carChoicePage->title = $user->displayUsername; DevUtils::prettyPrintObject($carChoicePage); exit(); } } But the template is not defined: ProcessWire\IndividualCarChoicePage Object ( [id] => 0 [name] => [parent] => /assetto-corsa-competizione/championnats-acc/championship/choix-de-voiture/ [template] => [title] => MyName [data] => Array ( [title] => MyName ) ) And then the admin is corrupted: The blue page is the parent page of the newly created, you see the arrow on left indicating it has a child, but this child is not displayed. And there's not way of solving this issue, I can not delete the parent page "Choix de voiture", the trash refuses to delete it! Now, if I move this code to another class, that is not extending Page and not located in /site/classes/ directory: IT WORKS! The new page is created with its template. Why?
  12. I would put it over here, on its on page: https://processwire.com/docs/start/install/ I put it on my todo list but I cannot promise anything as I hardly have free time these days.
  13. Thx @Christophe that's some good questions 🙂 I've updated the profile to hopefully answer all of them: https://github.com/baumrock/site-rockfrontend/commit/be55adae28ffe6a7aac83944284820f17afdaabf You don't need to use tailwind. If you don't want to use it just remove the _tailwind.css file. If you find anything happening that should not be let me know and I'll fix it.
  14. Someone could create a topic in the forum, maybe in the tutorials section, eg "how to fix request appears to be forged". And we could then simply add a link to that topic to the error message.
  15. It would be nice to have a documentation page that lists all possible causes and fixes for this general error message. The forum is littered with requests for help regarding this issue, but I think in development mode there could be a link to a ProcessWire documentation page that actually helps to resolve it. There isn't an infinite number of things that can go wrong, and I think it would be possible to list them all, or at least almost all.
  16. Hello, on PW v3.0.229 when setting $config->pagefileSecure, files (PDF inmy case) are still offered for download, even if the pages for those files reside in the trash. Can anyone confirm that behaviour? IMO assets of trashed pages should not be publicly available and $config->pagefileSecure should take care of that like it does for unpublished pages. Many editors without superuser priviliges aren't even aware of pages in the trash, unless we allow them to see the trash. So they would think that a trashed page is gone for good. In my case I now made the trash visible to those editors. But I also needed to instruct them to unpublish pages before moving them to the trash or delete them from the trash in order to make the files not appear publicly anymore
  17. Yesterday
  18. If anyone is using wire-cli, and you find you're getting a lot of PHP warnings about not being able to set session parameters after headers have been sent, this may help. You may need to add a custom session function to site/config.php to prevent ProcessWire attempting to setup session handling when it's bootstrapped by wire-cli from the command line. YMMV, but this seems to be working for me. NOTES: Adjust the path if your admin interface is not at /processwire/. If you need sessions on the public (non-admin) paths of your site, remove the "ADJUST THIS PATH..." line and change the final line to "return true;". /** * Custom Session Control * * - Keeps non-admin pages free of cookies/sessions * - Unless there is already a session cookie * - Prevents session start on CLI invocation (wire-cli etc.) * - Allows admin pages to use sessions */ $config->sessionAllow = function($session) { if ($session->hasCookie()) return true; $req_uri = $_SERVER['REQUEST_URI'] ?? false; if (false === $req_uri) return false; // CLI invocation? if (0 === strpos($req_uri, '/processwire/')) return true; // ADJUST THIS PATH IF NEEDED return false; };
  19. Hello Bernhard, I don't know how to properly write this post, I'll probably "refactor" it after. basic-page.php and home.php are empty template files. Are they only needed (even empty) if custom page class(es) php files that are related to them exist? Because latte files are used here I'm a bit confused about the (possible) role of these template files. In this site profile, in which use case(s) would they not stay empty? Could you please give one (or more) example(s)? Thanks in advance! NB: I don't want to use tailwind (for several reasons, one of them is that there are resets used but uikit uses normalize already, doesn't it? (I would perhaps prefer modern-normalize or another "at-rest" for the moment project related to one of the css grids evengelists (I don't remember her name right now)), BUT I'm curious about _tailwind.css, I think it's the first time I see the "_" prefix on a css file name.
  20. @Christophe Thanks to Christophe for suggestion the PHP Session save path, I set it to my writable folder and now it works, had to do in this in PHP Cpanel settings
  21. I'd assume this has to do with cookies, I see a folder path where it stores the session I will try clearing that because imported the one from my local machine into the remote server. I will update soon I
  22. Yes, I tried another browser, cleared my cookies and disabled sessionFingerPrint, I can't really pinpoint where the error might be coming from, unless i read the source code for Session::Validate
  23. Have you tried on another browser or in the incognito mode? Maybe you just need to clear your cookies.
  24. I can't get over this page, I've tried several solutions, and this happens on my server, I imported the SQL from my local machine into Phpmyadmin, is there anyway to fix this ?
  25. Thank you for pointing me to the right direction. 🙂 I don't often use hooks, but here is my current hook wich works for me: <?php $forms->addHookAfter('InputfieldFormBuilderRecaptcha::renderScript', function($event) { $url = "https://www.google.com/recaptcha/api.js"; $value = "<script class='require-consent' type='text/plain' data-type='text/javascript' data-src='$url' data-category='functional'></script>"; $event->return = $value; });
  26. Look, here in the docs is every information you need 😉 https://processwire.com/docs/modules/hooks/#what-methods-in-processwire-are-hookable
  27. It works with PrivacyWire if I edit the InputfieldFormBuilderRecaptcha.module on line 109 like this: <?php /** * Render Google reCAPTCHA script * * @return string * */ public function ___renderScript() { $url = $this->getScriptUrl(); return "<script class='require-consent' type='text/plain' data-type='text/javascript' data-src='$url' data-category='functional'></script>"; } But I don't think I can hook the ___renderScript function. Has anybody a suggestion how I can hook into the output of the script? Currently I don't have access to the FormBuilder support board, but I will renew our license soon, so I will ask there.
  1. Load more activity
×
×
  • Create New...