Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by guy

  1. just updated to v1.1.4 with the bug fix
  2. @ngrmm thanks for letting me know about that config issue. Will get that sorted in a min. On the SendGrid front I'm not too sure. SendGrid should show sent and received stats for all messages, therefore if you're not even seeing that (and the message is delivered) then something else is probably not quite right.
  3. @ngrmm I'm not exactly sure but I have just rolled an update to 1.1.3. I've tested this version and I can see sent and open stats within my admin console: https://app.sendgrid.com/email_activity let me know if this helps.
  4. @teppo thanks pal Yeah I noticed as soon as this was uploaded. Just tweaking it now but as you say no need for the hook as allows it to play better with other WireMail modules.
  5. Github: https://github.com/theGC/WireMailSendGrid What it does: Extend WireMail to bypass PHP mail and send mail via SendGrids Web API. What you need: A SendGrid account, use this to generate an API Key with Full Mail Send permissions. Once installed, the API Key is popped into the modules config and you should be good to go. Use Cases: It simplifies the process of sending email from servers by removing the need to configure sendmail or other email routing applications on the server. Instead it relies solely on PHP and offloads the sending to SendGrid which can be heavily configured via its UI to ensure better delivery rates for your domain.
  6. @kongondo thanks for looking into it, but I was after an API method which could be called from outside of the page, thus $input would not have the right context for the page you are interested in. More like $pages->get('/foo/bar'); when bar is a segment. Only really needed to know if the segment was valid. @LostKobrakai If you are testing for multiple segments then you'd usually enter them as separate strings within the $segments array. However if you've configured segment paths on your template you could add "some/subsegment" as a single string rather than breaking it apart. Really it needs expanding for this use case as that wasn't what we required from it. Regex tests and more complex lookups are somewhat out of scope. For our use case it worked nicely but that was multiple strings that are not segment paths. Might be interesting to play with the ProcessPageView method though...
  7. Haven't found an API method to support this but have a simple enough workaround if you have the $page at the root of the segments. /** * is the URL Segment valid for the page * @param {Page} $rootPage * @param {Array} $segments * @return {boolean} * */ function validSegments($rootPage, $segments = []) { if (!count($segments) || !$rootPage || !$rootPage->id || !$rootPage->template->urlSegments || (is_numeric($config->maxUrlSegments) && count($segments) > $config->maxUrlSegments)) return false; if ($rootPage->template->urlSegments === 1) { return true; } else if (is_array($rootPage->template->urlSegments)) { foreach ($segments as $segment) { if (array_search($segment, $rootPage->template->urlSegments) === false) { return false; } } return true; } return false; }
  8. Hey, Is there an API method to detect if a URL will match a URL Segment? i.e. If a template serving /foo/ allows segments, and you request /foo/bar/ Just need a boolean to indicate a hit or not. $segmentPage = $pages->get('/foo/bar/'); // returns nullPage At present I can't think of anything short of requesting the page and checking it's http status code: $responseHeaders = wireHttp->head('/foo/bar/'); Both slow and doesn't seem very reliable as the templates output could be manipulating this...
  9. Hey All, Our company is looking to take on PW devs for a variety of client projects. We're London based and ideally would like to work with devs that can come into the office. The projects are pretty wide in scope, so right now we're just looking for viable candidates to ping us a cover note with details on projects you've undertaken, how you utilised PW within them, highlight anything particularly brilliant you did.... If you can direct message me, I'll ping you my email and we can go from there.
  10. Is it possible to search on multiplier fields using a selector? i.e. $q = 'a search query'; $searchResults = $pages->find("textarea_multiplier%=$q"); This produces a fatal error: Error: Exception: Operator '%=' is not implemented in FieldtypeMultiplier Can this be done without looping over the contents of the multiplier?
  11. no worries, thanks for letting me know
  12. Is there a method to add markup to a single input field when building a form? At present I'd customise the forms markup: $form = $modules->get("InputfieldForm"); $form->setMarkup([ 'item_content' => "{out}<span class='custom-span'></span>", .... ]); Which works but adds the custom span to every inputFieldWrapper. Adjusting setMarkup on an individual field, i.e. $field = $modules->get("InputfieldText"); $field->setMarkup([ 'item_content' => "{out}<span class='different-span'></span>" ]); Calls the same method, setting $markup within inputFieldWrapper.php and adjusting the output of every inputFieldWrapper Therefore I was hoping for a way of appending to the inputfield or wrapper without it being global
  13. Awesome pal, that's sorted it.
  14. When using mysql v5.6 with the switch: --sql-mode=ALLOW_INVALID_DATES blank start and end dates get set to 2015 years ago, the dev branch solved this but unfortunately didn't fix the sql error.
  15. I'm getting an error with mysql version: 5.6.24 the error occurs when you don't populate either the start or end dates for a new jumplink. Elsewhere it has been caused by mysql v5.6 being a lot stricter with datetime fields. Where previous versions have just ignored certain data, v5.6 now raises an error. Starting mysql with the switch: --sql-mode=ALLOW_INVALID_DATES removes the issue.
  16. To add to the above: We experienced this issue with an established site when moving from http to https. Login requests either threw this error or simply returned you back to the login screen after silently failing. Following trying all the suggestions posted by Nico - apart from /site/assets/ chmod 777 - as he mentions wouldn't ever recommend that for production environments To remove the issue we installed the 'Session Handler Database' module and this fixed it.
  17. @chriswthomson - you've likely deleted the checkbox field this module sets up on install. To get past this error add a new field with a name of: sitemap_ignore then try running the uninstall again.
  18. Thanks Ryan, that's all useful. I actually signed up for ProCache a couple of weeks back, and am just testing it on the dev site so hopefully when that's live it'll sort it. For the mean time we administer the server and it's a dedicated box so we'll have a look at the config.
  19. Hey all, Since launching a site about a week ago we've been getting an error within the pw logs. It occurs about once a day and I was wondering if anyone could shed some light on what it is: 2013-10-07 14:19:00 ? http://www.google.com/?/ Error: Exception: DB connect error 1045 - Access denied for user 'abc'@'localhost' (using password: YES) (in /var/www/html/wire/core/ProcessWire.php line 96) 2013-10-08 08:05:05 ? http://www.baidu.com/?/ Error: Exception: DB connect error 1045 - Access denied for user 'abc'@'localhost' (using password: YES) (in /var/www/html/wire/core/ProcessWire.php line 96) 2013-10-09 08:41:06 ? http://www.google.com.tw/?/ Error: Exception: DB connect error 1045 - Access denied for user 'abc'@'localhost' (using password: YES) (in /var/www/html/wire/core/ProcessWire.php line 96) I assume their SE spiders trying to index the site but can't see why they'd be throwing an error like this...
  20. We're getting the phone number from a text input: $field = $modules->get("InputfieldText"); once submitted we're processing the form: $form->processInput($input->post); Sanitising the inputs, and then whitelisting the values using: $input->whitelist() along with returning a JSON version using wireEncodeJSON() The whitelisted version is outputting correctly with the 0, the wireEncodeJSON version drops it. I assume it's because it is passing it from the input as an integer whereas in your test it's a string. Might this be the case?
  21. Hi, We're pushing a few fields to JSON and were looking to use wireEncodeJSON to remove empty values. Just found an issue with the treatment of numbers. As they are interpreted as integers the prepending 0 is stripped. i.e. 0800 1234 becomes: 800 1234 we've moved over to using json_encode for now which is fine, just wanted to see if this was a neccessary behaviour.
  22. Hey Ryan, Thank you, having access to v0.2.0 has fixed the problem.
  23. I've been testing a form in Form Builder and am having an issue when I add more than 1 formbuilderfile input to the same form. The 1st works as expected, but the rest don't save the file to the entries database. You're just left with a reference to its name but a file size of 0kb. If you set the 1st formbuilderfile input to accept 2 files it works fine. The issue only occurs when adding multiple formbuilderfile input's. The issue isn't with the input itself, as moving the order in which they appear means the first in the form will work as expected and the 2nd and later will always fail. P.S I've just started working with Form Builder and haven't access to the support forum yet. By all means move this post if needed, just please let me read it....
  24. Been using Ryans code for the login page and I'm finding I get a server error if the user enters a username which includes an @ the error seems to be coming from: $username = $sanitizer->username($input->post->username); $pass = $input->post->pass; // this line has nothing to do with the problem, just left it in for consistency $u = $users->get($username); When sanitizing the username, the value we get back is not loved by the $users selector. The error is logged as: For myself I didn't need the user to be able to enter @ as I'm not passing an email, therefore I've flipped out the sanitizer to use name instead, i.e. $username = $sanitizer->name($input->post->username); I assumed this was a bug with the username sanitizer, however if there's a code change I could make it would be great to hear.
  25. Hey Diogo, thanks for your thoughts. From an admin perspective would creating a page for each of a pages sections (perhaps 10 in some places) not look rather messy? I'm not saying its the wrong approach, just wondering how it could be laid out so it didn't look all a bit confusing for the end user. If using sub pages for each of a pages sections, I'd assume it best to keep them directly under their parent so as to make the job of finding the part you want to edit as easy as possible. This would mean they'd be sitting next to actual sub pages and I worry that even if they are hidden the whole thing will look very cluttered. The site has over 130 pages so I want to keep its admin as simple to understand as possible, hence isolating a pages sections within a repeater only found on that page seemed more practical. When I'd considered the pages root for each section I imagined the admin structure looking something like the following, would this be accurate? Page 1section 1 section 2 section 3 section 4 Sub-Page 1section 1 section 2 section 3 section 4 Sub-Page 2section 1 section 2 Sub-Page 3section 1 section 2 section 3 I can see this getting a little messy (some pages will have up to 10 sections) with a large number of pages. That said pw will only show the sub pages the users requested to see, so this would control the clutter a bit. ********** I've had a thought ********* Assuming the above model is acurate it may be possible to clean this up using just CSS and a bit of jQuery. Processwire places each page within a div and adds the template name to the end of a class, i.e. PageListTemplate_section-hero (the template for which is called section-hero). Therefore if we established a rule that all section templates were prepended with a string like "tbs-section-" (something a bit random) follwed by the sections name, these could be automatically hidden via the stylesheet: [class^="PageListTemplate_tbs-section-"], [class*=" PageListTemplate_tbs-section-"] { display: none; } Then we could pop a button onto the pages inline actions menu which would allow the user to toggle these pages on and off. Still thinking about how best to do this as I'd rather avoid changing the core modules of pw, the functions which would be good to hook with are in ProcessPageList. I'll look into this a bit more and post back what i come up with. Feeling quite positive about this method, Thank you again Diogo for your input, it really helped, hopefully the above sits better with you.
  • Create New...