Robin S

Members
  • Content count

    2,566
  • Joined

  • Last visited

  • Days Won

    123

Robin S last won the day on May 20

Robin S had the most liked content!

Community Reputation

4,080 Excellent

3 Followers

About Robin S

  • Rank
    Hero Member

Profile Information

  • Gender
    Male
  • Location
    New Zealand

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Robin S

    Thanks horst. I did some searching and thought it might be useful to compile a list of the issues, which are mostly (or perhaps all) resolved now. Solved: The issue mentioned above where some images were lost when multiple large images were uploaded simultaneously. https://github.com/ryancramerdesign/ProcessWire/issues/1871 https://processwire.com/talk/topic/13522-problem-with-ajax-images-upload-and-sessionhandlerdb/ Solved: Session times recorded incorrectly when MySQL timezone does not match local time. https://github.com/ryancramerdesign/ProcessWire/issues/1838 https://processwire.com/talk/topic/13307-session-handler-database-times-out-by-two-hours/ Solved: Truncated session data when Tracy Debugger installed. https://processwire.com/talk/topic/15784-what-will-trigger-a-csrf-error/ Solvable: Old sessions not deleted on some Ubuntu servers. I have struck this one myself and @horst's suggestion in the post below solved it. https://processwire.com/talk/topic/5796-session-handler-database-do-not-delete-old-sessions/?do=findComment&comment=56596 Fatal error thrown on Windows server using IPv6. https://github.com/ryancramerdesign/ProcessWire/issues/1596 https://processwire.com/talk/topic/12935-issues-moving-from-iis-localhost-machine-into-windows-server-production/ Slow performance with large number of sessions. https://processwire.com/talk/topic/18718-session-handler-db-issue/ But with huge amounts of traffic performance may be affected without SessionHandlerDB installed too. Login problems after website migration. Might be solvable by clearing caches. https://processwire.com/talk/topic/5317-cant-log-in-this-request-was-aborted-because-it-appears-to-be-forged/?do=findComment&comment=142160 https://processwire.com/talk/topic/13781-problems-after-installing-remote-copy-to-local/
  2. Robin S

    Great, that will be really useful on sites with premium (paid) memberships where you want to prevent multiple users being sneaky and sharing a single account. Thanks @kixe and Ryan. I've avoided SessionHandlerDB apart from when I really need it because I've heard of strange issues that have eventually been traced back to this module. Unfortunately I can't remember what those issues were. For regular users of SessionHandlerDB: are there any issues or incompatibilities with other modules to be aware of? Nice! I only wish the announcement had come a couple of weeks earlier. I spent some time recently modifying ProcessForgotPassword for just this purpose. Excellent, I have closed an old request relating to this.
  3. Robin S

    I think of the API reference as the official docs rather than the cheatsheet. The cheatsheet hasn't had a comprehensive update for a long time and there are loads of things in the API reference that aren't in the cheatsheet. The loadOptions / joinFields options are covered in the API reference: https://processwire.com/api/ref/pages/find/ loadOptions (array): Optional associative array of options to pass to getById() load options. https://processwire.com/api/ref/pages/get-by-id/ joinFields (array): Autojoin the field names specified in this array, regardless of field settings (requires autojoin=true). (default=empty)
  4. Robin S

    Welcome @Shoekrates, FormBuilder is a Pro module so you can get support from Ryan in the dedicated FormBuilder sub-forum.
  5. Robin S

    In AdminThemeUikit (might be dev branch only at the moment) you can choose from a few colour options for inputfields: But it would be more flexible to use your browser dev tools to inspect the markup in Page Edit, find what class is unique to the inputfield you want to change, then use AdminOnSteroids or AdminCustomFiles to add a custom CSS file to change the background colour.
  6. The module does not support this, but you could edit the module file, adding the following line here: $embedCode = str_replace('youtube.com', 'youtube-nocookie.com', $embedCode); If you later update the module the change would be overwritten and you would have to redo it.
  7. It would pay to think about how it will work if a user has permission to edit a child page but not its parent. Hiding non-editable pages means hiding any branches under those pages.
  8. You can't add a Field object to a form, but rather an Inputfield object. Field::getInputfield() would come in handy here.
  9. Robin S

    It's annoying, right? You could thumbs-up the existing request for a change to this behaviour: https://github.com/processwire/processwire-requests/issues/186 And as a workaround in the meantime try this hook in /site/ready.php: $wire->addHookAfter('ProcessPageListActions::getExtraActions', function(HookEvent $event) { $page = $event->arguments(0); $actions = $event->return; if(isset($actions['copy']['ajax'])) { unset($actions['copy']['ajax']); $actions['copy']['url'] = "{$this->config->urls->admin}page/clone/?id={$page->id}"; } $event->return = $actions; }); If you find it's not working for you then it might be getting called before the equivalent hook inside ProcessPageClone, in which case you could try experimenting with the "priority" option for hooks: https://processwire.com/api/ref/wire/add-hook-after/
  10. Robin S

    There are also specific elements within the $page->render() $options array for prependFile and appendFile, see here. So you can do: foreach($page->children('template=child') as $child) { echo $child->render(['prependFile' => null, 'appendFile' => null]); }
  11. You have to handle the login throttle exception:
  12. Robin S

    Hi @tpr, a feature request: could you add a cache-busting query string (e.g. using filemtime) to the assets added from the "Asset Paths" section of AOS? Thanks!
  13. Robin S

    My regex is rather weak also, but I think this will work... $cc = $modules->get('ServiceCurrencyConversion'); $text = $page->body; $regex = '/\x{20AC}([0-9]+\.?[0-9]+)/u'; $text = preg_replace_callback( $regex, function($matches) use ($cc) { $dollars = number_format($cc->convert('EUR', 'USD', $matches[1]), 0); return "{$matches[0]} (\${$dollars})"; }, $text ); echo $text; Would makes sense to put this into a simple Textformatter module and use it that way. See TextformatterNewlineBR for a basic example to start from.
  14. Robin S

    Hi @bernhard, A bit OT, but in your development of this module have you had the need yet to get the path or URL of the pages you are including in a query? Do you know a way of getting or constructing the page path/URL from the database data without getting Page objects involved? From a quick investigation it looks like PW builds the path/URL with methods in the Page class but I was hoping to avoid having to load Page objects. Any tips?
  15. Robin S

    @Andreas Augustin It's interesting - if you dump/log the $value here directly in InputfieldTextarea::processInput you can see that the method is called for every language. However, you can only actually hook the call for the default language - for the other languages the method must be called in such a way that hooks are not triggered (by calling the method name with the three underscores included). So you'll probably have to get the other language values from $input (either the WireInput argument to the method or via the API $input variable). For example... $wire->addHookBefore('InputfieldTextarea::processInput', function(HookEvent $event) { $inputfield = $event->object; $input = $event->arguments(0); if(!$inputfield->hasField || $inputfield->hasField != 'your_field_name') return; // The value for the default language $default_language_value = $inputfield->value; // The value for French language $french = $this->languages->get('french'); $input_var_name = "{$inputfield->name}__{$french->id}"; $french_value = $input->$input_var_name; // ... });