Finally, a new release of digests! What was the hold up? Busy doing other things, vacations, but also it’s very hard to test all the permutations and to fix bugs that manifest only in cron modes. Such bugs must be tracked down by sending messages to the Admin log through debug statements. Very tedious!
As for what’s new, really except for closing bugs there is no new functionality. It should be more stable and reliable. You can download the archive on my Digests page or on GitHub. If upgrading, make sure to follow standard procedures. The first post of the digests topic provides a lot of guidance.
Change log:
New features
- None
Major bugs fixed
- Fixed bug in mailer that incorrectly reported the hour that was run using 12 hour format (0-12) instead of 24 hour format (0-24), leading to false log entries such as hour 1 could actually have been hour 13
- Fixed bad positional parameters in the DIGESTS_DISCLAIMER language variable, fix from petr-hendl pull request (thanks)
- Fixed bug that creates a user timezone object if it does not exist. In cron mode sometimes it was not present or deallocated. It is needed to make dates and hours print out in a language independent fashion.
Minor bugs fixed
- All hours and time zone offsets are cast as floats since time zones are not necessarily offset by an integer from UTC.
- Default text for maximum display words in the ACP is no longer the same as what is in the UCP. Needed to revert to the previous language string because -1 in this value will show full display text by default.
- Language string LOG_CONFIG_DIGESTS_HOUR_RUN uses positional parameters, fix from petr-hendl pull request (thanks)
- When digests are run manually they are no longer stopped if it’s been less than an hour since a digests was sent to the same user
- Fixed certain admin log entries that were added even if the logging option was turned off
Tweaks and improvements
- New check_send_hour helper function reduces duplicative code and centralizes all send hour offset logic
- PHP and template variables with gmt in the name are changed to utc
- <br /> changed to <br> when used inside of variables and expressions
- <hr /> tags in templates changed to <hr> when used inside of variables and expressions
- Constants are used to identify the mode the mailer is running (manual, regular and phpbb), makes code easier to read
- Function validateDate renamed validate_date for consistency
- Pretty quotes ’, “ and ” in language strings since this was an issue flagged by the extension review team while reviewing my Smartfeed extension
- Removed language string LOG_CONFIG_DIGESTS_DIRECTORY_CREATE_ERROR (no longer needed because this error is not easily trapped in ext.php)
- digests_html.txt uses new .newline class which makes it less likely digests will look odd, from petr-hendl pull request (thanks)
- Version check checks a new file specific to phpBB 3.2 releases
- Logic for creating and removing a /cache/phpbbservices/digests folder moved into ext.php from /cron/task/digests.php where it logically belongs as it should happen when the extension is installed
- Constructor for digests class is fully documented
- Moved board disabled check (which keeps digests from going out when the board is disabled) into the should_run function of the cron
- Made the logic in the run function of the mailer less complicated
- Since largely the same code was used to create attachment markup for both posts and private messages, moved it into a function
- Log date format shows two digit months, days and hours