chrizz

Members
  • Content count

    63
  • Joined

  • Last visited

Community Reputation

33 Excellent

About chrizz

  • Rank
    Full Member

Profile Information

  • Gender
    Male
  • Location
    Berlin, Germany

Recent Profile Visitors

3,044 profile views
  1. hehe... fair enough to check for a closing tag Next time I'll promise I'll use correct markup which would have solved the problem right away. Thanks for your support
  2. @horst it doesn't have any tags (except the tags I am adding to the message manually). I tried a downgrade to 0.2.3 => no success - same problems I just installed version 0.2.5 => still no tags but the signature is there... this is what the mail content looks like (headers are removed) --3e089748ac63f63eedf33dc907a71870 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable hallo -- PLAIN blablabla --3e089748ac63f63eedf33dc907a71870 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <strong>hallo</strong> HTML <br><br><strong>blablabla</strong> --3e089748ac63f63eedf33dc907a71870-- so it seems as if my problem has been solved - but it's still somehow weird that there are not tags... If you want me to share more details and/or sources please let me know. Would be glad if I can help you Thanks for providing this module & the support!
  3. @hellomoto I couldn't reproduce this. Which version of WireMailSmtp you're using? I am on the same PW version but I am currently struggeling with the HTML signature. Using this code, triplechecked that at HTML signature is stored in the WireMailSmtp settings, but - and thats the fun fact - it does not work within a HTML mail - but the signature is added to the plaintext. $mail = wireMail(); $mail->from($email, $name); $mail->to("me@me.com", "Me"); $mail->subject('new message - '.$config->httpHost); //$mail->addSignature(true); ==> has no effect either since I chose "send signature with _every_ message" in the module settings $mail->bodyHTML($message); $mail->send(); Has this happened to anyone before? And if so: how did you solve this?
  4. i was referring to your post here: https://stackoverflow.com/questions/34225720/keep-getting-you-cannot-serialize-or-unserialize-pdo-instances-in-phpunit-usin namespace Test; include_once(__DIR__."/../../../../index.php"); //Bootstrap to Processwire CMS class ImageTest extends \PHPUnit_Framework_TestCase { /** * @backupGlobals disabled * @backupStaticAttributes disabled * @runTestsInSeparateProcesses * @runInSeparateProcess * @preserveGlobalState disabled */ protected function setUp() { //$this->testpages = wire(pages)->find("template=fingergames|template=songs|template=poems"); } [...] } And no, I am not using PHPStorm but Netbeans. Finally I managed it use PHPUnit with PW modules. In the end it was a combination of a config XML backupGlobals="false" backupStaticAttributes="false" bootstrapping the PW index.php and include a setUp method within the test class with the correct namespaces Example (maybe someone needs something like this) <?php use PHPUnit\Framework\TestCase; class testMe extends TestCase { protected function setUp() { global $wire; $this->wire = $wire; } public function test_getNextRuntimeFromCycle() { $res = $this->wire->modules->get("testMe")->myMethodWorks(); $this->assertEquals(true, $res); } }
  5. quite an old thread, but I started to test some basic functionality and I can't get this to work... I don't use selenium but only PHPUnit to test some functions within modules. But whatever I try it fails. Basically I can decide whether I want to see this message: PDOException: You cannot serialize or unserialize PDO instances or - if I follow these rules https://blogs.kent.ac.uk/webdev/2011/07/14/phpunit-and-unserialized-pdo-instances/ - ERROR: application encountered an error and can not continue. Error was logged. Anyone who struggled with this as well? And - more important - any suggestions or solutions? big thanks! btw @FrancisChung: based on the stackoverflow post I think you just pasted the annotations at the wrong place. It must be outside the class {}
  6. I'd add it to the config just because to me a locale is like a config value. init.php might be a little late because auto load modules are already initialized https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/
  7. Does the XML feed contain *all* data always? I had to deal with a slightly different issue (include a facebook news stream with search, pagination etc), and I decided to create real PW pages from all feed items. This gave me the flexibility to use the build-in functions without building an extensive Facebook API connector. How much items do you have to handle? Happy guess: you can create a WireArray (https://processwire.com/api/arrays/) from the feed data which contains already some build-in methods (unfortuantely not the pagination thingy)
  8. I quickly wanted to follow up this issue. I am not sure if edition a post including a mention triggers a notification
  9. @adrian thanks a lot for sharing this and for pointing me in the right direction! To clear the original values you can just pass "null" to the "to" method: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/WireMail.php#L152 Same works for cc & bcc, but to be honest, I only tested this in combination with WireMailSmtp. It might look different without WireMailSmtp (e.g. no cc/bcc) The whole hook function looks like this and it works as expected. $this->addHookBefore('WireMailSmtp::send', null, function($event) { if(!$this->config->debug) { // when not in debug mode do nothing return; } $mail = &$event->object; // store orgiginal recpients $recipients = array( 'to' => $mail->to, 'toName' => $mail->toName, 'cc' => $mail->cc, 'ccName' => $mail->ccName, 'bcc' => $mail->bcc, ); // reset all original recipients $mail->to(null); $mail->cc(null); $mail->bcc(null); // add debug recepient $mail->to = 'Dropbox <dropbox@my-domain.com>'; // create debug information for mailbody $debug_body = '### DEBUG INFO ###<br />'; $debug_body .= 'TO: '.implode($recipients['to'], ', ').'<br />'; $debug_body .= 'CC: '.implode($recipients['cc'], ', ').'<br />'; $debug_body .= 'BCC: '.implode($recipients['bcc'], ', ').'<br />'; $debug_body .= '### / DEBUG INFO ###<br /><br />'; // replace original mailbody $new_mailbody = str_replace('<body>', '<body>'.$debug_body, $mail->bodyHTML); $mail->bodyHTML($new_mailbody); return; });
  10. @adrian although tracy seems to be really oversized for this use case but it is quite interesting and it works thanks for the tip!
  11. I was wondering if it'll be possible to hook the ___send method to manipulate the recipient(s) and body of the mail. I was able to hook the method basically but I couldn't manage to manipulate the original data :/ Thanks in advance for any hints use case for this: In debug mode (e.g. local or on staging) all mails should be send to a dedicated dropbox instead of the original recipient. This information should be added to the mail body instead. Original e-mail - send to xy@domain.com Hello XY, thanks for your email. [...] Manipulated e-mail - send to dropbox@developer.net # Debug Info # Original recipient: xy@domain.com Hello XY, thanks for your email. [...]
  12. here they are. Didn't find any relevant meta data in the image itself. It's imho only about the quality of the jpeg (97 vs. 50). The first one hits the memory limit, the second one didn't. @horst edited examples.zip
  13. well... in theory... ^^ I just tested it: jpeg 3888 x 2592 original file size: 5,1 MB ==> hits the PHP limit same image after saving it again with only 50% quality jpeg 3888 x 2592 new file size: 0,8 MB ==> does not hit the PHP limit, scaling works as expected I expected these results because reducing the quality does not reduce the actual size of the image but the number of information (e.g. in the first example every pixel has it's own color definition while in the second example color information is combined e.g. 4 pixels contain the same color ==> file size is reduced) but maybe @horst is deep into the theory and might be able to explain how it really works
  14. @LostKobrakai thanks for having a look! But to make sure (and avoid extra work) I was not talking about chunked uploads but only about a file size limit for a single file. Uploading a 5MB file (4000x4000px) works fine on the shared webspace but when the ImageResizer enters the game the PHP memory limit is hit when it's trying to resize the image to 1000x1000px To avoid this we need to optimize the file size before uploading it to PW. Having a 2MB 4000x4000px image works fine when it is resized. In my imagination the file/image field get a new option: max file size. The validation (simple JS check if the file selected for uploading is larger than the limit) happens on client side with the FileReader
  15. Are there any plans to add a client side file size validation for file and image fields? Would it be a possible way to use the FILE API to check the size before uploading? Using max dimensions is not useful at all imho. Or - if not - how do you handle the case that clients can upload large images (large = means file size) which break the PHP memory limit on a shared webspace?