• Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About simonsays

  • Rank
    Full Member

Recent Profile Visitors

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

  1. simonsays

    I am still unsure why this fatal error was not displayed when using pure PHP (outside of module scope).
  2. simonsays

    @flydev Thank you very much for your help! Solved the issue. Would have struggled if it had not been for your help.
  3. simonsays

    Looks like this could be the thing. Thank you very much! Will get back shortly.
  4. simonsays

    That's the main issue, unable to reproduce it on my local computer My local XAMPP is 7.2.8 and server runs on 7.0.27 However, I did not believe that the php version could be the issue.
  5. simonsays

    Same result, both with and without
  6. simonsays

    I tried both ways and there is no real difference. I tried both } catch (SoapFault $e) { print 111;exit; return $this->client = false; } } catch (\SoapFault $e) { print 111;exit; return $this->client = false; } It reaches the "111" part but even with exit; the error is still thrown
  7. simonsays

    Also, forgot to mention, that the service works perfectly when SOAP service URL is correct and up. I just want to handle situations when it is not available for one reason or another.
  8. simonsays

    Hello, I am facing a mysterious issue. I have a module for connecting to external SOAP service (which is initialized along with the project). Since SOAP service times out every now and then, it is crucial to handle this timeout and hide error from the user. I have this bit of code in the module public function init() { ini_set('default_socket_timeout', 5); $configData = $this->wire('modules')->getModuleConfigData($this); if (!isset($configData['url_wsdl']) || empty($configData['url_wsdl'])) { return false; } $url = $configData['url_wsdl']; try { $this->client = new SoapClient($url); } catch (SoapFault $e) { return $this->client = false; } $this->session_id = $this->wire('input')->cookie('SSID'); } It works well in my local XAMPP environment and does not show any error or exception when connection fails. However, on the server I keep getting ugly error displays at the bottom of the page (red when loggen in and generic "internal" when I am logged out from admin). At first I thought, that this had something to do with php error settings on the server, but afterwards I tried this bit code to see if it works outside of PW and it did! No error was thrown despite forcing PHP errors. <?php error_reporting(E_ALL); ini_set('display_errors', 1); ini_set('default_socket_timeout', 5); try { $client = new SoapClient('faulty url goes here'); } catch (SoapFault $e) { echo 'wrong'; } var_dump($client); So, I assumed that processwire has to do something with that. What exactly is the issue and how can I disable displaying these errors? try ... catch block is not enough and I already tried force setting $config->debug to 'false'
  9. Logged issue on github
  10. @ryan Found a bug which involves a certain scenario. My version is 3.0.98, therefore I am not sure if it has been fixed in later versions or should I raise an issue. Steps to reproduce: 1. Do a clean install of Processwire 3.0.98. 2. Install PageFrontEdit module. 3. Add repeater field and add an image field inside of it. Assign it to any template (I picked "home") 4. Create a page and add a button to open an edit modal dialog echo '<edit field="' . $page->fields->implode(',', 'name') . '" page="' . $page->id . '">'; echo '<a>edit</a>'; echo '</edit>'; 5. Open modal dialog on the front-end and upload an image to repeater. Save changes. 6. Open the dialog again and crop the image. Click "Apply" and "Save and replace". Expected behaviour: The form and the image field are updated with the new cropped image preview. Actual behaviour: Nothing is updated and old image preview stays. Through web developer tools and "network" tab I got a json error {"error":true,"message":"Field 'headline' is not applicable to this page"} The bug does not happen when editing the same page in admin as well as for "image" fields which are not inside a repeater. Has this been raised or fixed already? Or is this something you are unaware of?
  11. simonsays

    Thank you very much, I'll try (been on a holiday myself). I'd rather use your module instead, though...
  12. simonsays

    @adrian Hey man! Did you get a chance to reproduce the issue?
  13. simonsays

    Take your time, man. You are not paid for this I was just looking for a temporary solution while you fix your module.
  14. Hello, Moved this topic from "Modules". Put that there by mistake. to avoid caching I am trying to end up with a hook to append page->modified timestamp to all image urls. NB! I am aware of noCacheUrl method, but this one's no good as I want them to be out of cache on page update only. NBB! I have tried CustomUploadNames module but it breaks the image path when cropping images inside the repeaters. NBBB! Ideally it would be image->modified timestamp, which is unfortunately not updated on crop or focus. I have come up with something like wire()->addHookAfter('Pageimage::url', function($event) { $page = $event->object->get('page'); $p = ($page instanceof RepeaterPage) ? $page->getForPage() : $page; $event->return = $event->return . '?nc=' . $p->modified; }); This one has several issues though... 1) I end up with multiple appends, eg. ?nc=321223242?nc=4232424342323, etc 2) Page modified date is not updated when cropping an image (unless saving it afterwards, which is an overkill imho). Can anyone think of a better solution for that?
  15. simonsays

    @adrian I have come across a similar issue. My filename pattern is {$page->name}-{$file->filesize}-[YmdHis]. Rename on save is checked. The plan was to avoid caching, both on server side and on the client side, as our prod servers have several layers of cache. I tested with image field inside a repeater and crop functionality. Initially the image is uploaded fine and replacing image also works. However, when I crop it and save the page, the image still gets the old path (which is now broken), both in admin and on the front-end. I looked into both the DB and the filesystem. DB record (field value) is not updated and stays the same on crop. However, image filename is updated. Once again - this happens on crop, inside a repeater field. I tested without a repeater and indeed, it works fine.