• Content count

  • Joined

  • Last visited

Community Reputation

49 Excellent

About ethanbeyer

  • Rank
    Full Member

Recent Profile Visitors

532 profile views
  1. @Barry after logging in to SendGrid, have you looked here? I've been using SendGrid, and tested it just now - it is working for me! You will have to create an API key, but they walk you through that in the link above.
  2. @horst Can you tell me how/where in the module this hijacks/extends wireMail()? I'm glad that it does, but I am desperate to understand how this works. new WireMail(); // WireMail new wireMail(); // WireMail wireMail(); // WireMailSmtp $mail->new(); // WireMailSmtp This has highlighted one of the many parts of my PW knowledge that is majorly lacking. Edit: Ok. Finally get it. Here's how it works, for anybody else that wonders... wire/core/boot.php loads JUST WireMailTools. WireMailTools::new() looks for any classes that overlay on WireMail. If WireMailSmtp is installed, it will be the class that is returned. If none are found, it defaults to WireMail. Shooooo-wee. Nice to know!
  3. I have a role with the following permissions: Up until today, I've had no issues with this Role. But now when I log in with a test account with this role, the admin page list never loads. Looking at the Javascript console, I see: TypeError: Q is null I have no idea what's causing this.
  4. Interesting... I've been saying for a while that I'd love to help the docs get better. As they are now, I think they're pretty good - but things could always improve, and if there is one thing in development I am uber-passionate about, it's documentation!!
  5. Today I noticed the Fieldgroups class is missing from the reference, and I wasn't sure why! Does anyone know? Also, I feel like the docs would be easier to parse/navigate if the API Variables were shown alongside the class they were an instance of. Config ($config) Field Fields ($fields) Fieldgroup Fieldgroups ($fieldgroups) Fieldtype HookEvent Inputfield InputfieldWrapper MarkupPagerNav Module Modules ($modules) ... Page ($page) Pages ($pages) ... I'm also aware of the API Gen reference page (, which is more robust, but a little harder to parse.
  6. I know this is old, but I think your error might be because you're trying to attach $content to the current instance of ProcessWire. I think it might work if you did this: return $content->wire('pages')->find("parent=/"); Since $content is a new instance of ProcessWire, you should be able to do things like this: $contentModules = $content->wire('modules'); $contentForms = $contentModules->get('FormBuilder');
  7. Had to report back and say that in a multi-site environment, where all the sites are using the same ProcessWire core, it is possible to "share" modules by the method listed above, with no need for symlinks! $config->paths->siteModules = $config->paths->root . 'shared/modules/'; $config->urls->siteModules = $config->urls->root . 'shared/modules/';
  8. You're right. require_once("creds.php"); // this works require_once("./creds.php"); // this doesn't No idea why.
  9. To me, saving database credentials to a Git repository, even if that repo is private, is a big no-no. So I've been tinkering with different ways to deploy sites to production environments without saving the database credentials to the repo. I know that there is a the config-dev.php option. But that hasn't worked for me, as I will explain later. I added this to my config.php: $config->env = "dev"; if($config->env == "dev") { $config->dbHost = 'localhost'; $config->dbName = 'processwire'; $config->dbUser = 'root'; $config->dbPass = 'root'; $config->dbPort = '3306'; } else { require("./{$config->env}.config.php"); } So if $config->env = "production", production.config.php should be loaded: $config->dbHost = 'localhost'; $config->dbName = 'processwire-production'; $config->dbUser = 'username'; $config->dbPass = 'productionPassWord'; $config->dbPort = '3306'; I can't see anything wrong with the syntax of this at all - but for some reason, if that file is added with require() or require_once(), ProcessWire never loads. If it's loaded with include(), I get an error about the page not being found, and there being no install.php present. So it seems like for some reason, there is no way to include a file in config.php, which confuses me immensely. How my brain works I'll try to explain my thought process behind this a little more. I think it's a good idea for dev environments (especially those that come with a Vagrant box and a defined database already installed) to include dev-level database creds. It should just work. If someone works on this site after me, they shouldn't have to spend a ton of time getting a config file set up. Secondly, having a config.php file and a config-dev.php file frustrates me because for the developer that comes after me, they could really use the config-dev file! But if it's in the repo, it gets deployed. If it gets deployed, it gets called on the staging/production server, and that is no good! Also, config.php and config-dev.php would in most cases pretty much completely mirror one another with the exception of database creds, and maybe debug or a few other things. That is why I want to have all the configs in the repo within config.php except for the tiny bits that are environment-specific. They should be able to be included, right?
  10. I have a question about Multiple Site implementation, and how to possible "share" modules between them. First, required reading: I'm dealing with Option #1. The way this works is that in the root directory of a site, there is an index.config.php file that denotes what domain is mapped to which site-*/ directory. The project I am working on has three site-*/ directories, each with their own site-*/modules/ directory. What has happened is that a lot of the modules from site to site are the same. I was wondering if there was any way to "share" modules between sites in the Multiple Site setup, via symlink or alias, or potentially if there was some roadmapped feature that @ryan has planned to solve this issue. Either way, any help/pointers would be appreciated!
  11. Thanks for the help, @Robin S and @LostKobrakai! You guys rock.
  12. Oh my gosh - have I been reading these docs wrong all this time? hahahahaha I thought $page->files was an attribute that got set at some point and was a Pagefiles array of all files added to that page... Well that definitely solves one thing!! Thank you, @Robin S! I'm still very confused why some of the fields don't show up as a part of the $page->data array, though.
  13. @tpr I am not sure I know what you mean, but I changed the code within Tracy Debugger to $fg = $this->wire('fieldgroups')->get('document'); $t = $this->wire('templates')->get('document'); $example = $this->wire('pages')->get(1624); dump($fg, $t->fields, $example->fields, $example->files, $example->document_Files, $example->data); ...and all the dumps were the same as when the Page variable was named $page.
  14. This is a strange error I am totally unsure how to fix! It started when I was trying to get a file from $page->files. I know that there is a file in a field called document_Files. But $page->files returns null. So I popped into Tracy Debugger and wrote this code: $fg = $this->wire('fieldgroups')->get('document'); $t = $this->wire('templates')->get('document'); $page = $this->wire('pages')->get(1624); dump($fg, $t->fields, $page->fields, $page->files, $page->document_Files, $page->data); Resulting in 6 Dumps: $fg, $t->fields, $page->fields all result in the same object, which is to be expected. (fieldgroup): Fieldgroup {#173 +"count": 4 +"items": array:4 [ 1 => "title" 199 => "document_customizableCheckbox" 197 => "document_Files" 200 => "document_thumbnails" ] } But then it gets strange with $page->files null ...and $page->document_Files. Pagefile {#267 +"changes": array:1 [ 0 => "formatted" ] +data: array:6 [ "basename" => "example.pdf" "description" => "" "tags" => "" "formatted" => true "modified" => 1497976118 "created" => 1497976118 ] } I would expect those two to match. But obviously they don't. But then it gets weirder, still! $page->data should have four elements in the array - one for each field in the Fieldgroup - but two don't show up: array:2 [ "title" => "Introduction" "document_Files" => Pagefiles {#264 +"count": 1 +"items": array:1 [ "payroll_vault_brochure_markbeaton_2016_12_01p.pdf" => "payroll_vault_brochure_markbeaton_2016_12_01p.pdf" ] } ] Also, in the $page->data array, document_Files (the field) outputs as a Pagefiles class, whereas getting the field directly only returns a Pagefile. I don't even know where to start! Has anyone else had something like this happen? I have looked at the database starting with the template. I can confirm it has the correct fieldgroup_id, and that fieldgroup has all the correct fields. The page in question also is the correct template.
  15. I've built a couple PW sites now, and often I break my directories up like this: assets files cache logs sessions active.php index.php installed.php backups fonts js modules scss templates vendor But I kind of wish, in that schema, that I could change it to something like this: modules resources fonts js images scss storage backups cache files logs sessions active.php index.php installed.php templates vendor My reasoning is that JS/CSS/Theme Images/Fonts are site assets (or "resources"), while the caches/files/logs/sessions are more storage. And that is fine to set up manually - but in looking over the config.php file, I can't find a place where I can set that so that ProcessWire will respect it. Every part of this CMS is flexible, so I do assume there is a way to do this - I just don't know what it is. Has anyone else done something like this?