Jump to content


  • Content Count

  • Joined

  • Days Won


Everything posted by horst

  1. horst


    What is the debuglog saying which server is connected, what is the servers response, what is the transfer protocol etc etc. the debug log from the debugsend() method should tell what happened.
  2. horst

    HTTP/2 Push

    Yep, but it definetly will change at those smaller webhosting plans too, at least if they are setup using ubuntu etc., because (I heard from a medium german hosting company) that upcoming ubuntu etc. will change apache's default setup to work with HTTP/2 (and PHP as apache module is dropped and no more available then 😞 ).
  3. After looking to it a second time, one may come to be able to see the not so sad truth, that is: With ProcessWire we have an opensource project on a very high level in regards of code base, stability & homogenity and much much more along those lines. AND all of of this is directly related to Ryan's decision to *work through all pullrequests* himself to deeply understand, modify, and adapt the code, so that he himself is ALWAYS & IMMEDIATELY able to fix bugs resulting from those code changes. (Even after years, when maybe some people who have sent PRs have left the project again and are no longer reachable.) This has a lot of advantages! And it has, (as everything has), some cons. One of them is, that he is something like a OneManCodingArmy :-), but he is only *one* man. And I don't want him to waste his time to read through every github issue, plus every github pullrequest AND ANSWER TO EVERY ONE of them, in order to explain "why he doesn't want to do it that way, or that he doesn't have time now to do it, or that it could produce a lot of side effects, or, or, or". And one of my fantasies is that he might already be unhappy about not having the times to be carefree active here in the forums, as it was possible for him until about 4-5 years ago. It might feel ungrateful for him to read such a post. This, as a result of his disciplined behaviour, to advance the project as far and effectively as possible. Every week, or almost every day. (( @ryan Did you imagine or wish this when you turned your code into an open source project in 2010? I'm just kidding! But it may sometimes be tiring to be confronted with the same thing over and over again, when the answers have already been given many times and the internet supposedly doesn't forget anything. But when people "don't have time" to do a little research first, or try to look at it from a different angle before, but (in the worst case without any impulse control) always bring up the same things again. Pffhhhh, for my well-being that would be nothing. πŸ˜‰ I want you to have time and energy to work in your own flow & rhythm on *your* ProcessWire. Your ProcessWire, that you gifted to us. πŸ˜‰ )) @bernhard The truth is, (not the sad truth, not the happy truth, just the truth): it's one of two possible choices that he took 10 years ago. With all the pros and cons. In my opinion, every member of the community should respect that and never forget it. Because all that we have learned to love and appreciate about ProcessWire, all that has enabled us (even in early days, when we may not have had much code experiences) to write our own modules, is the result of that decision and I wouldn't want to miss it. The alternative would be to abandon this course and (quality) control. But all the people I've spoken to in the past, all of whom have more than 15+ or 20+ years of experience in the software business and open source sector, have consistently told me: "Be glad that it is this way. There were so many projects that started that way, but opened up and broke 1 or 2 years later." And about @netcarver question: I have contributed a lot of stuff in regard of image handling in PW. But it seems that less then 5% of it is reflected in githubs contributors list. The most things, where Ryan included my PRs as is, we have had conversations and colaborations about and on it on github or private via PM or email, until the code was accepted by him (in regard to his principles, anounced above). Aaand, it could be, that it also has something to do with the fact that he not only made the experience that I am still approachable after 6 years when it comes to issues, decisions or questions, but that I also not only understood his decision, but also respect it. Even if it has a negative effect on me in some areas. (But that's also just a fantasy of mine, with no claim to truth.) πŸ™‚
  4. Thanks for reporting! I'm using PHP 7.2 and currently don't have a PHP 7.3 server running. I will update my dev setup when I find time and fix this.
  5. horst


    Because the current test part only does the connection part, (ping the server and login), within the modules settings screen. It was written for PW 2.4 (and is backward compatible until now). I think this would be a good addition, maybe besides the current connection test.
  6. horst


    You can add some debug code into a template file and call a page with it: $to = array('me@example.com'); $subject = 'Wiremail-SMTP Test ' . date('H:i:s') . ' Àâü Γ„Γ–Γœ ß'; $mail = wireMail(); if($mail->className != 'WireMailSmtp') { echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; } else { $mail->from = '--INSERT YOUR SENDER ADDRESS HERE --'; // <--- !!!! $mail->to($to); $mail->subject($subject); $mail->sendSingle(true); $mail->body("Titel\n\ntext text TEXT text text\n"); $mail->bodyHTML("<h1>Titel</h1><p>text text <strong>TEXT</strong> text text</p>"); $dump = $mail->debugSend(1); } So, in short, instead of using $mail->send(), use $mail->debugSend(1) to get output on a frontend testpage. The output is PRE formatted and contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection, like this one:
  7. https://lmgtfy.com/?q=site%3Aprocesswire.com%2Ftalk+password+recovery+ryan&s=g&t=w
  8. Pagination? --> https://processwire.com/api/ref/paginated-array/ Add pagination properties to your find selector, (as Dragan already suggested), and store relevant parts into session variable(s).
  9. try to increase the memory limit via .htaccess file php_value memory_limit 256M and check it by looking to the phpinfo() before you try to increase and afterwards, if it does take effect.
  10. Hey, lets pull it down to this: serving the full filesystempath should work everytime, if the file is_readable(), URL β€žmayβ€œ work most of the time, as the pdf-lib will expand it to the full filesystempath. In both scenarios finally the full filesystempath is needed to read, parse, import the imagefile into the pdf object. πŸ˜‰
  11. I think you need to pass the full (absolute) filename to the mpdf->image() method, not a relative one and not(!) a URL. $filename = "/absolute/filepath/to/the/image.jpg"; // or when using PWs pageimage $filename = $image->filename; // do a test in your script for debugging: if(!is_readable($filename)) die('Missing file'); $mpdf->AddPage('L'); $mpdf->Image($filename, 0, 0, 210, 297, 'jpg', ...
  12. https://mpdf.github.io/reference/mpdf-functions/image.html
  13. 😒 @justb3a Good luck on your (new) way and many, many thanks for all your contributions !! πŸ˜„ ❀️ πŸ‘
  14. @Jens Martsch - dotnetic, I had set it up some years ago under win7 with a (sort of) proxy batchfile. It is a single file, that I pointed the modules default protocol settings to. Don't know if this can be of help for you, as I hadn't read all the posts here. But here is the windows batchfile that I use(d): @GOTO START <?php $editor = "C:\\Program Files\\NuSphere\\PhpED\\phped.exe"; if($argc > 1) $url = $argv[1]; list($file, $line) = explode('&line=', str_replace(array('editor://open/?url=file://', ''), '', urldecode($url))); if(is_file($file)) { exec("\"$editor\" \"$file\" --line=$line"); } exit(0); ?> EXIT :START @ECHO OFF SET PHP=C:\php\php.exe %PHP% "%0" %* EXIT Short explanation: the batch script (maybe named something like "tracyopener.bat", located somewhere in the system path) is called with the tracy default params for file & line. the first line tells the win batch interpreter to skip the PHP section and start at the line where the php exe is defined the next line calls the PHP interpreter, passes the own script to it "%0", followed by all other params "%*", what is an alias for %1 - %9 when the PHP interpreter processes the script, the first line is interpreted as HTML or text output and therefor ignored. the next lines get and prepare the passed params for usage with my preferred editor NuSphere PhpEd, using the exec() function.
  15. Hi Jens, what Dragan said, if you can switch & test to PW 3.0.142 with the new implemented images subfields, that would be simple to setup and protect for usernames / ids and modified or uploaded timestamps. But you need to test it in a dev environment first, as it is "brandnew". I believe the best hook for all file and image related things on upload is >before "InputfieldFile::fileAdded" < (https://processwire.com/talk/topic/22252-admin-hook-image-upload-watermark-pim/?tab=comments#comment-190948
  16. I build and use one template that is bound to a single page in PW where both are simply named "ajax". I can access it per URL "/ajax/" and use it for everything that needs to send or retrieve data in the background. Here is an example from a project where different forms send data that need to be validated first and then send to final (external) destinations. The client browser optionally gets back HTML like "success messages" or error descriptions. <?php namespace ProcessWire; /*============================================================================== XXXXXXXXXX :: site/templates/ajax.php 2019-07-04 ==============================================================================*/ /******************************************************************************* * * This template file handles form submissions that are raised via AJAX! * * Sanitize, validate, log and submit to final destinations. * * // how the used JS looks like $.ajax({ url : gAjaxUrl, // /ajax/ type : 'POST', async : true, dataType : 'html', // returned data has to be HTML data : submitData, // submitted data object success : function(markup) { if('' != selector) { // a selector string to match the $(selector).html(markup); // markup container } } }); ... * *******************************************************************************/ // only process AJAX calls if(!$config->ajax) return 'WRONG ACCESS METHOD'; // only process POST requests with valid required id if(!$input->post->hidden_id) return 'WRONG ACCESS METHOD'; // ... followed by all project specific validations etc. So, with your example I would check if there is a post value named theme, and if the value is one out of a whitelist of valid theme values: // does this belong to theme selection if($input->post->theme) { $validThemeValues = ['dark', 'light']; if(!in_array($input->post->text('theme'), $validThemeValues)) { header('HTTP/1.1 403 Forbidden'); return; } $session->set('selectedTheme', $input->post->text('theme')); return; } // does this belong to another thing? if($input->post->anotherThing) { // first validate, then process data // ... return; }
  17. Not 100% sure, as I do not work with options fields, but if you want to search for title values other the default language, you need to add the ID of that language to the fieldname. As example, if your italian language would have the ID 1020, you would have to query for: encyclopedia_item_type.title1020={$type} see:
  18. @ryan Oh WOW, a dream comes true! 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍
  19. @David Karich & @kalimati Which PW version(s) do show this behave? AND: which ImageSizerEngine(s) have you enabled there? (GD | IMagick) We had a change in what image types are supported by IMagick and need to revert back some sorts of PNGs, especially 8bit PNGs are not correct supported by IMagick, and in very rare cases there also was wrong handling for some 8bit-PNGs in GD-Engine. Maybe you can provide the informations plus one or two of the (original uploaded) images in a ZIP to me?
  20. Yes, you will get it like with this code: $out = new \stdClass(); $out->clients = []; foreach([0=>['id'=>'abc'], 1=>['id'=>'xyz']] as $client) { $out->clients[] = $client; } header('Content-Type: application/json'); echo json_encode($out); see: https://www.php.net/manual/en/language.types.object.php#118679
  21. I believe this would result in erroneous JSON syntax. Your 'clients' need to be a (key or property) element of either an object or an array, not a preceding string.
  22. @Hardoman If I understand correct, you want to watermark the original image. Is this right? If so, you may want to watermark the original image directly. This way you don't need to delete the original image and copy / move around the watermarked variation. If you look into the PIM docs, you will find a description how to work on system files instead of Pageimage objects. This would be the way to go. see this post, the 3 tip: https://processwire.com/talk/topic/4264-page-image-manipulator-1/?tab=comments#comment-41748
  23. Hi @Noel Boss, - I haven't understand why you need init() and why you are not able to use ready(). (Maybe, because you haven't told πŸ˜‰ ) But what about testing with prioritizing your hook(s)? Maybe with init() it may run lately, or in ready() (as one of the early birds), will do what you are after?? Links: https://processwire.com/docs/modules/hooks/#hook-priority and
  24. Ah ok. There is no build in solution for this. You have to build something yourself. For example, if there is currently no use of tags, (or an expandable usage of tags), with this imagefield, you may setup tags with predefined values, so that the user can select one if he like to. If this is not possible due to restricted other usage of tags, it may become very uncomfortable, as there are currently no other fields bundled together with an image (besides description and tags). I'm not sure if the imageextra module from justb3a is uptodate with the current devstate (?), If so, and if tags are no option, this would be the way to go.
  25. I don't understand what's the question means ?? When you upload an image to a field with 3 defined crop settings, there will be created 3 default crops. So there ever is a crop present, but not a manually user defined one. ?? You can do everything with it what you can do with the regular pw core imagefield. (The CropabbleImge is an extended PW core imagefield) $image->url; $image->width(500)->url; $image->size(300, 400, ['sharpening' => 'medium', 'quality' => 85])->url; Thanks for pointing me to this!
  • Create New...