cosmicsafari

Members
  • Content count

    43
  • Joined

  • Last visited

Community Reputation

6 Neutral

About cosmicsafari

  • Rank
    Jr. Member
  1. The site has a regular flow of visitors so I don't suspect it is that, the timing out issue could be possible right enough. What would be the best way to un-jam it if thats the issue? Uninstall/Reinstall LazyCron?
  2. Hi all, I have noticed that LazyCorn seems to run maybe once or twice and then just stops. Has anybody else encountered this, I have the following within 2 different modules. public function init(){ $this->addHookAfter('ProcessModule::executeEdit', $this, 'configurableButtons'); wire()->addHook('LazyCron::every15Minutes', $this, 'autoGenerate'); } public function init(){ wire('forms')->addHookAfter('ProcessModule::executeEdit', $this, 'configurableButtons'); wire()->addHook('LazyCron::everyHour', $this, 'getExport'); } Does having multiple LazyCrons setup cause any issues?
  3. Thanks for the reply but I think I have sussed it, not sure why it was never an issue up to this point right enough. I updated my code from above to try: $this->log(1); try { $p->save(); } catch (\Exception $e) { $this->log($e); } $this->log(2); Which gave me an error mentioning using $p->setOutputFormatting(); So I updated to $this->log(1); try { $p->setOutputFormatting(false); $p->save(); } catch (\Exception $e) { $this->log($e); } $this->log(2); Which appears to have fixed the issue.
  4. Hi all, Im a bit confused by an issue I have come across today. I have a module which connects to a third party (once an hour using LazyCron), parses a publicly available XML file, turns it into useable information which I then use the API to save as PW Pages. On the whole this has been working great however today I noticed that it kept failing on one of the imports. After doing some investigation I realised its appears to be dying at the save page stage. From the documentation $page-save() should return either True/False, so I thought I would update the code to reflect this while debugging. $this->log(1); $bool = $p->save(); if($bool){ $this->log('Saved successfully'); } else { $this->log('Fail to save'); } $this->log(2); However the script only gets to the save() part and then appears to terminate. Then when checking the error log the latest entry is always just '1' Any ideas as i'm a tad confused why I at least don't get a response of some kind?
  5. Huzzah! Managed to figure it out. For anybody else with this issue, there is a setting for the Page Selection fieldtype to allow UnPublished page at the bottom of the Details tab.
  6. Hi all, From my attempts it seems like this is not possible but thought I would raise it here before scrapping the idea and trying something else. I have an importer script reading a third party feed and creating some pages (page_type_A) based on that. It also creates some other pages (page_type_B) which are by default set to unpublished as the third party don't seem to have control over some of the data they send us, so we set them to unpublished so that someone on our end needs to approve them, so far so good. The issue I have encountered is that page_type_A at creation uses the API to set one of its fields to a particular page_type_B, the field is setup as PageSelector. When I look at the database this seems to work fine, but if you go into page_type_A the Page Selector list is always preset to blank? I updated the Page Selector and set the Selector String to use "include=all" which does populate the drop down with all the correct pages but since there all unpublished it never seems to be preselected to the one which is actually saved as in the DB. Hope that makes some sort of sense.
  7. That sounds promising however do you have an example, I tried adding it to my module config page but get: InputfieldWrapper: Skipped field 'test' because module 'InputfieldMarkupInputfield' does not exist Scratch that got it to work with : [ 'name' => 'test', 'type' => 'Markup', 'value' => 'Huzzah!' ]
  8. Hi all, Just wondering if its possible to just add some basic output to my modules config page. I was wanting to output a bulleted list of some information which I will be pulling from a third party. Retrieving the data is fine i'm just not sure how to output it to the config page? From what I can see in the link below, it only seems like you can append form items to the page. https://processwire.com/blog/posts/new-module-configuration-options/
  9. Hi all, I am using the formSubmitSuccess form builder hook to send a copy of the form submission to a third party. However I couldn't figure out how to get the submissions form type at this point, the reason being is that I only want to send the data onto the third party for certain form types. I don't have the submission details being passed into the hook, wasn't sure how to achieve this so at the moment I have it doing a DB query to pull the latest submission details for that form type so I'm rather stumped about how I can go about achieving this. Hope thats makes sense.
  10. Apologies I totally misunderstood your original post. Thats tremendous, fills exactly the purpose I need.
  11. Changed to use ProcessModule::executeEdit, and it fires the method. However as you would imagine it fires it on the page load when you try to view the page with the button on it which isn't ideal. If there was a way to pass the value of the button to the hooked method I could just use a conditional but again im not sure if thats possible
  12. Hi all, Not sure if this is even possible but I would like to add a button on my modules configuration page that triggers a method to run. The method in question belongs to the module itself. Is this possible? So far I have: MyModule.module public function init(){ wire('forms')->addHookAfter('InputfieldSubmit:processInput', $this, 'foo'); } public function foo(){ error_log('IT WORKS!!'); return; } MyModuleConfig.php public function __construct() { $this->add( [ [ 'name' => 'Foo Button', 'type' => 'InputfieldSubmit', 'value' => 'Fire Foo Method', ] ] ); } This renders the button but so far haven't had any luck getting the method to fire successfully. I haven't found any examples from my investigations so apologies if this is an impossible request.
  13. Hi all, A few of our clients are having issues receiving emails sent via form builder after a client submits a form. They display fine in certain clients but in Outlook especially the body content is either missing or the raw code is displayed. Does anybody have any ideas why this might be the case or any ideas about how to diagnose the issue? Not sure if this is an issue with the emails themselves or the server from which they are being sent. Just wondering if anyone else has experienced anything similar?
  14. Figured this might be useful for others. Turns out it was something to do with the version I was running. I downgraded the Form Builder plugin from 3.0.1 to 3.0.0 and the links in the administrator emails worked as expected.
  15. Hi All, Just a quick question, if a form has an upload field should there be a working link in the subsequent email which allows you to view the uploaded file? As it stands only the name and size of the file appears in the email although viewing the source it appears wrapped in anchor tags, albeit without any href attribute. I'm not sure if this is the correct result or if I have somehow managed to cause this and there should be a working link to the uploaded file.