Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/21/2023 in all areas

  1. Oops, I'll do it again: I'll present DDEV at the next PHP Meetup Vienna in August! Also I'll record the talk so that everybody here that is not yet using DDEV can watch it on my youtube channel to get a quick impression. The title is already found thx to the help of chatgpt ? Now I ask for your input what you love about DDEV, what problems it solves for you and what you like most about it. And maybe also what you didn't like on other systems that you've used before. Where do you think does it stand out from the crowd? What does it do similar to other available options? What are those options (just to get a birds eye view)? ... I'll let the first words up to you ? Thx for your input and help ? MEMO https://processwire.com/talk/topic/27433-using-ddev-for-local-processwire-development-tips-tricks/?do=findComment&comment=234217 ngrok for mollie webhooks chatgpt poppler-utils aliases endless loop -> ddr custom docroot
    3 points
  2. Hey, I will try to test it with PW 3.0.220 + and make a PW 3.x namespace version of it, as I think, every PW 2.x installation that is using it, does not need more new WireMail-SMTP updates from now on. (As some or one of you suggested!) I try to do it this week! @ceberlin @Ivan Gretsky @zoeck ...
    2 points
  3. I wish I could help in one way or another but for now I just can say... it works... as expected. PW 3.0.220 - PHP 8.1 - DDEV What's your setup looking like: - Which PHP version? - Which environment? - DDEV, XAMP, MAMP, Laragon? Did you clear the compiled files and made a refresh after that? /adminurl/module/# (at the bottom) CLEAR COMPILED FILES
    2 points
  4. From PHP.net: https://www.php.net/manual/en/language.basic-syntax.phptags.php I read it as follows. While opening short tags can be disabled and are removed in newer versions, the shorthand echo <?= can‘t be configured, isn‘t (yet) deprecated and hence should work fine on older and latest PHP versions.
    1 point
  5. What users may not like about ddev is the need for WSL2 or Docker on Windows compared to e.g. XAMPP stack. Devs are often using Linux/Mac or Windows/WSL2 anyway, so this shouldn‘t be a big hurdle for devs, while it may be for users wanting to try stuff quickly on Windows.
    1 point
  6. A couple of simple things: Good support for xdebug So easy to switch php versions
    1 point
  7. That's what I experienced, yes. My short echo always works, I'm using that all over and have never every anywhere had to enable short open tags. But I've never been using <? instead of <?php and that's what I needed the settings in php.ini for! So the essence is that <? and <?= are different kind of short tags and the former is bad and the latter is good ? @Stefanowitsch
    1 point
  8. Not fact-checked, but chatGPT suggests this as a history of short tags in PHP... Does this fit with what you are seeing (given the version of PHP you might be running?)
    1 point
  9. [See this post as a PUBLIC DRAFT for an upcoming post / aka thought dump] It's just a thought in my (confused) head right now... but shouldn't we, ProcessWire, the Community, and the ProcessWire Module Devs somehow focus/target a master release/version with PHP 8.1 as minimal version in the near future? Not only for ProcessWire itself but all modules. I'm not talking about ProcessWire 4.x but maybe 3.1.x or 3.2.x or something? Just to have a clear cut in some way. Almost everyone I talk to is looking for and talking about PHP 8.1. Right now there are so many fast moving parts in ProcessWire (CKEditor/TinyMCE, JS Updates, Core Modules split and moving to the database, and what not) itself and in terms of PHP 8.1 - either it works or it's somehow having issues, while everyone seems already working with it.
    1 point
  10. Hi @snck, This is definitely a bug. The quick solution would be to resize your image before calling render (e.g. $img->size(1600, 534)) but I've pushed a fix which should resolve this. Please download the latest version (1.0.5) and let me know if that hasn't fixed it for you. If not could you please let me know what the values for $img_tag_width and $img_tag_height are in the 'markup' option as I'll need this to debug further. Cheers, Chris
    1 point
  11. @zoeck yes that is possible. ProcessWire was fiddling with the modules recently. - I drop a note in PW "issues".
    1 point
  12. Please note: I changed my initial forum name zx80 to my Github name cwsoft. Never thought I will release two PW modules within a month after my initial registration to the ProcessWire community forum ?. Hope this makes it more transparent for possible future contributions to the PW eco system.
    1 point
  13. @ceberlin "Updated 2023/03/09" -> The module has just received an update ? Or is this related to the problems with the current dev version?
    1 point
  14. @horst is this still supported?
    1 point
  15. And again! Added the ini settings and went instantly from 83MB to 2.7MB ? I've created an issue here, because I think that ryan is simply not aware of that and it should not be too hard to fix I guess/hope: https://github.com/processwire/processwire-issues/issues/1760 Like it if you want to support the request ?
    1 point
  16. 1 point
  17. @Spinbox. Glad you got it sorted. What @netcarver said is very important. You should never trust user input. Sanitize their inputs (except for passwords; these need to be validated though). Padloper does not involve itself directly with $input->post->email in this case; @Spinbox, you will need to sanitize that yourself since Padloper does not save users on your behalf. However, Padloper cleans the values for the order customer. In your case, you could just get the customer email from the order. Something like below (amendment of your code): untested (but sanitized) - e.g. I don't know how your current $user is getting shippingAddressFirstName. <?php namespace ProcessWire; function processOrderSaveCustomer(HookEvent $event) { $input = $event->input; $user = user(); $users = users(); // $sanitizer = wire('sanitizer'); $currentUser = Null; /** @var Page $orderPage */ $orderPage = $event->arguments('orderPage'); if ($user->isLoggedin()) { $currentUser = $user(); } else { // $currentUserName = $sanitizer->email($input->email); # ---- OR ---- /** @var WireData $orderCustomer */ $orderCustomer = $orderPage->get('padloper_order_customer'); $email = $orderCustomer->email; // ++++++++++++ if($email){ // IF WE HAVE A USER NAME $currentUser = $users->add($email); $currentUser->email = $email; $users->setCurrentUser($currentUser); } } if ($currentUser) { $currentUser->of(false); // @NOTE IF WE HAVE A USER FROM ABOVE, THEY WILL ALREADY HAVE AN EMAIL SO THIS CHECK IS REDUNDANT // $currentUser->email = !empty($currentUser->email) ? $currentUser->email : $sanitizer->email($input->post->email); $currentUser->pass = !empty($currentUser->pass) ? $currentUser->pass : $input->post->pass; $currentUser->newsletter = $currentUser->newsletter != 1 ? $currentUser->newsletter : (int) $input->post->newsletter; $currentUser->addRole('login-register'); $currentUser->save(); } if ($currentUser->newsletter != 1) { // load module into template $mc = modules()->get("SubscribeToMailchimp"); // add merge_fields to fill out user data, based on your audience MERGE_FIELD options // You need to setup the fields at "Settings > List fields and *|MERGE|* tags" first! $mc->subscribe($currentUser->email, ['FNAME' => $currentUser->shippingAddressFirstName, 'LNAME' => $currentUser->shippingAddressLastName]); } } That's right. A user ID is only added to the order customer if they are logged in. The user ID is saved in the $orderCustomer (which is the value of $orderPage->padloper_order_customer). Below pseudo code assumes you already have a logged in user and the $orderPage: <?php namespace ProcessWire; /** @var WireData $orderCustomer */ $orderCustomer = $orderPage->get('padloper_order_customer'); $orderCustomer->userID = $user->id; $orderPage->save('padloper_order_customer'); Hope this helps.
    1 point
  18. From a cursory search on the feasibility of this request: AVIF support does appear to be possible, but there would be more checks required to verify the server configuration meets the minimum requirements... ImageMagick supports AVIF as of v7.0.25 or later. PHP's GD library - as of PHP version 8.1 - supports AVIF when compiled with AVIF support, and also requires support via the libavif module. The libavif module must be version 0.8.2 or greater. At this point there might need to be a decision to determine how to handle image processing: Does a PNG get uploaded and processed and converted to both AVIF and WEBP, and then the smallest of the three options is what is served - or does the site admin decide one or the other (despite gains or losses)? Add in any variations and that's a lot of processing just for a single image.
    1 point
  19. Assumes "categories" is a multiple Page Reference field and that you have a hex colour defined on each category page: $wire->addHookAfter('ProcessPageListRender::getPageLabel', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'accommodation') { $out = ''; foreach($page->categories as $category) { $out .= "<span class='uk-label' style='background-color:$category->hex_colour'>$category->title</span> "; } $out .= $page->title; $event->return = $out; } });
    1 point
  20. Passwords are in a table called field_password. They are hashed and salted, and not reversible, so no way to set or change them without going directly through the API.
    1 point
×
×
  • Create New...