Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

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

simonsays's Achievements

Full Member

Full Member (4/6)



  1. It was just a quick question to confirm, whether repeater field downgrade works out of the box or requires additional extending. Thanks for the reply.
  2. @LostKobrakai I have this code for repeater migration, however, I noticed something. Not sure if it is a bug or the way it should be. <?php class Migration_2018_11_18_00_00_00_RepeaterAccordionField extends FieldMigration { public static $description = "Add repeater for accordion"; protected function getFieldName() { return 'repeater_accordion'; } protected function getFieldType() { return 'FieldtypeRepeater'; } protected function fieldSetup(Field $f) { $f->label = 'Repeater accordion'; $f->collapsed = Inputfield::collapsedNever; $repeaterFieldGroup = new Fieldgroup(); $repeaterFieldGroup->name = 'repeater_' . $this->getFieldName(); //Add fields to fieldgroup - add others as necessary $repeaterFieldGroup->append($this->fields->get('title')); $repeaterFieldGroup->append($this->fields->get('content_columns')); $repeaterFieldGroup->save(); $repeaterTemplate = new Template(); $repeaterTemplate->name = 'repeater_' . $this->getFieldName(); $repeaterTemplate->flags = 8; $repeaterTemplate->noChildren = 1; $repeaterTemplate->noParents = 1; $repeaterTemplate->noGlobal = 1; $repeaterTemplate->slashUrls = 1; $repeaterTemplate->fieldgroup = $repeaterFieldGroup; $repeaterTemplate->save(); $repeaterPage = "for-field-{$f->id}"; $f->parent_id = $this->pages->get("name=$repeaterPage")->id; $f->template_id = $repeaterTemplate->id; $f->repeaterReadyItems = 3; //Add fields to the repeater - add others as necessary $f->repeaterFields = $this->fields->get('title'); $f->repeaterFields = $this->fields->get('content_columns'); $f->save(); } } If I rollback the migration, it deletes the field. But does not affect the fieldgroup. So, when I try to run the migration for the second time - it throws me an integrity violation error (originates from fieldgroups table). Is this the expected behaviour?
  3. No, I am using master (which is 3.0.98). Does it work there?
  4. Hello, Do you know, if there are any module alternatives or planned fixes for existing export and import functionality? I do understand that it is still in development phase and for the most part it works well. The only problem is that attached files (e.g. images) are not imported/exported together with pages.
  5. Bump. Any update on this? No feedback here, none on github ?
  6. I am still unsure why this fatal error was not displayed when using pure PHP (outside of module scope).
  7. @flydev Thank you very much for your help! Solved the issue. Would have struggled if it had not been for your help.
  8. Looks like this could be the thing. Thank you very much! Will get back shortly.
  9. 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.
  10. 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
  11. 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.
  12. 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'
  • Create New...