Jump to content

BitPoet

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    61

BitPoet last won the day on December 12

BitPoet had the most liked content!

5 Followers

Profile Information

  • Gender
    Male
  • Location
    Near Munich / Germany
  • Interests
    programming, writing, scuba diving, long distance hiking

Recent Profile Visitors

11,531 profile views

BitPoet's Achievements

Hero Member

Hero Member (6/6)

3k

Reputation

27

Community Answers

  1. MAMP Pro should allow you to enable screen output of errors for PHP when you're in expert view. That should give you a better idea of what's going wrong.
  2. There's no direct selector option, but you could get all templates that use the field first, then use those in the selector. Unless you use the field in repeaters or related types, fieldgroup name = template name. $tpls = $fields->get('checkbox_export')->getFieldgroups()->implode('|', 'name'); $ps = pages()->find("template=$tpls, checkbox_export!=1, sort=id, include=hidden, status<" . Page::statusTrash);
  3. Nice. I didn't think of having "intermediate" mail pages for further processing, but it does make sense.
  4. The problem is that PHP has a bunch of errors that can't be caught (or better worded, not worked around with custom error handlers - try-catch only catches Exceptions, which are just one side of the medal). The number of unrecoverable errors has been dwindling while version numbers rose, but there are still a few left, and they tend to show up unexpected. Re queueing or not: you can always implement both. It could even come with its own script. If the filtering and page creation is handled by methods in your module, it should even be a a piece of cake. Are you planning to open source your module? If yes, I could implement the feature and send a pull. The thought behind that is that there are different ways to deliver mails and different reasons to add them as pages, from posting blog content to implementing a support ticket system on top of PW (an idea that has been nagging me for a long time), and probably a lot of others.
  5. I get the same error, but I can install just fine. I don't think the dev environment plays a role there, it's the browser running the JS. Why is the error preventing you from continuing? The installation page should still be there. However, you should be able to comment out line 843 in wire/modules/AdminTheme/AdminThemeUikit/scripts/main.js with no ill effects if Safari for some weird reasons prevents the page from working because of the error.
  6. It's always a tricky decision whether to include packages or have the user run composer. If license terms allow it, I've so far included the full source to make sure users don't end up with incompatibilities introduced by future versions. This, of course, sometimes means to react quickly if a vulnerability is discovered in a package my module relies upon, but I still prefer that to dysfunctional installations. About using parser libraries at all - PHPs native capabilities are a PITA, and there are reasons why almost everybody uses a third party parser package (I had to rely on native stuff for a bunch of email parsing scripts that extracted contents of non standard conformant emails, and that was no fun at all). Which to choose? A hard decision. Both are mature projects. One thing that comes to mind would be the dependency on PECL mailparse, which also has a known memory leak that can hit hard if one tries to process a larger number of mails in a loop. This and more intuitive handling of addresses could be a point towards Mail-Mime-Parser. On the other hand, a few content part handling methods feel more intuitive for PHP-Mime-Mail-Parser. No clear winner there, but I'd personally go for the simpler option from the user's perspective (i.e. Mail-Mime-Parser). You might consider working with a queue directory as an option instead of using a direct pipe, which would improve resilience and performance. In cases like the database going away, all emails could still be written to the directory and processed later in a (lazy) cron job. Interfacing software is my main job description, and one philosophy I've acquired is to always finish pipe jobs as fast as possible.
  7. Glad you got it working. So it is an include_path issue after all. Looks like the pipe call doesn't change the current working directory, so PHP looks for index.php somewhere in the cPanel file tree.
  8. That's strange. Is "." in include_path (otherwise PHP might not find index.php with a relative path)?
  9. You can enable error logging for php-cli by setting error_log in /etc/php/cli/php.ini to something like "/var/log/php_errors.log". If you have dos2unix on your system, you can recursively convert all files to proper LF line endings from within your PW directory. find . -type f -name '*.php' -exec dos2unix {} find . -type f -name '*.module' -exec dos2unix {}
  10. Inside site/templates, it would have to be include('../../index.php'), though you should be able to place the script anywhere outside the PW directory as long as you specify the correct path to the index.php that lives in PW's root directory. You'll have to make sure, of course, that the user under which cPanel runs has read access to the PW directories. Since php-cgi und php-cli sometimes use different php.ini files (depending on your OS), this may also be worth checking. Otherwise, if you're including the correct index.php and have the namespace set to ProcessWire, wire() and 'new Page()' will work.
  11. Big thumbs up for that idea. If the timing is right, I might even make it to both, since I'm planning to head across the pond and hike the John Muir Trail next summer. Love the preload method. I've got a shop solution built on PW with about 120k orders and 150k order positions by now, all as pages. Performance is becoming a bit of an issue in the backend with long range price change statistics and detailed Excel exports, and this seems like a perfect use case.
  12. WireDatabasePDO's constructur doesn't connect to the database yet. This is either implicitly done when the query or exec(ute) methods are called, or explicitly by invoking $db->pdo(), which will return the underlying plain PDO object.
  13. Yes, I did. Sorry for the mixup. If upping wait_timeout, deleting individual entries from your image field's table is normally an option, but I'm not familiar with ImageExtra. So I'd make sure to have a working database backup before attempting it. One thing you could try is setting the field you want to exclude from saving to hidden.
  14. Is that on a shared hosting server? The error indicates that the execution time of a mysql query was exceeded or a memory limitation in the database was reached, in which case the server aborts the query and drops the connection. Those are often pretty close knit on shared hosts. If you have access to the database itself, the first thing to look at would be wait_timeout. "SELECT @@wait_timeout" will give you the seconds MySQL will spend on a query. If that is very low, you can try setting a higher per-session value through $config->dbInitCommand in site/ready.php. $config->dbInitCommand = "SET NAMES '{charset}'; SET wait_timeout = 300";
  15. The question prompted me to put FieldtypeSketchyDate on GitHub. It's a small module I started writing for a solution that never went anywhere, so its pretty basic. It may be a starting point though. In short, it lets you enter 2024 or 2024/10 or 2024/10/11 in the date value, and it also lets you search for 2024/10 and returns all pages with a date between 2024/10/01 and 2024/10/31 as well as those where 2024/10 was entered. So far, it just validates the formatting through the HTML pattern attribute. Proper date validation and calendar UI are still on the todo list.
×
×
  • Create New...