[RC] Digests 3.2.4-RC11

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
canonknipser
Registered User
Posts: 1131
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by canonknipser » Mon May 29, 2017 6:33 pm

After a clean install, the default first user account ("founder") has no timezone set because he is likely created before all the board settings are stored (function user_add uses $config['board_timezone'] as default ). You need to set up the proper time zone in admin's UCP.

For the guest account, it seems intentionally that the user_timezone is empty - his user data is setup with the boards timezone when his data is grabbed from the database, as far as I understand the code in phpbb/user.php around line 146 - but the timezone string is not written in user_timezone in the user object; instead a timezone object called timezone is created in the user object (around line 227 in the same file)

Thus, my code has the ultimate fallback to UTC ;)
Greetings
Frank
phpbb.de support team member
English is not my native language
New arrival - Extensions and scripts for phpBB
no support via PM or mail

User avatar
MarkDHamill
Registered User
Posts: 3310
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Mon May 29, 2017 7:56 pm

Your logic sounds fine, but I think a new administrator sets his timezone in the user control panel when logged in. It's confusing because there is no reason to remember to do something like this. You would expect that the default board timezone would be used for the admin. It would not be a hard change to make. My bug report is here:

https://tracker.phpbb.com/browse/PHPBB3-14404?filter=-2

I see no harm in giving the guest user a timezone. Default it to GMT or the board timezone.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
canonknipser
Registered User
Posts: 1131
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by canonknipser » Mon May 29, 2017 8:12 pm

I agree, setting the timezone can be done in phpbb/user.php, just add $this->timezone = $user_timezone after line 223

Or, use the event core.user_setup and add the correct timezone there until the core code is fixed
Greetings
Frank
phpbb.de support team member
English is not my native language
New arrival - Extensions and scripts for phpBB
no support via PM or mail

platima
Registered User
Posts: 5
Joined: Wed Jan 11, 2017 2:09 am

Re: [RC] Digests 3.2.3-RC10

Post by platima » Wed May 31, 2017 1:48 am

Hey team,

Recently I upgraded our phpBB installation from 3.1.someting to 3.2.0, and went from digests 3.0.6 to 3.2.3.

3.1.(10?) and digests 3.0.6 was working perfectly, however, we wanted to use some functionality that phpBB 3.2.0 had, so had to upgrade. I followed the doco to the tee and it NEARLY works, except two things:

1. When I go ACP -> Extensions -> Edit Subscribers, I get this error:

Code: Select all

SQL ERROR [ mysqli ]

Unknown column 'user_digest_send_hour_gmt' in 'field list' [1054]

SQL

SELECT *, CASE WHEN user_digest_send_hour_gmt + 8 >= 24 THEN user_digest_send_hour_gmt + 8 - 24 WHEN user_digest_send_hour_gmt + 8 < 0 THEN user_digest_send_hour_gmt + 8 + 24 ELSE user_digest_send_hour_gmt + 8 END AS send_hour_board FROM (phpbbec_users u) WHERE user_type <> 2 ORDER BY lower(username) ASC LIMIT 20
2. When I try a manual run, I get:

Code: Select all

SQL ERROR [ mysqli ]

Unknown column 'user_digest_type' in 'where clause' [1054]

SQL

SELECT u.*, s.* FROM (phpbbec_users u CROSS JOIN phpbbec_styles s) WHERE s.style_id = 4 AND ((user_digest_type = 'DAY')) AND (user_digest_send_hour_gmt = 1 OR user_digest_send_hour_gmt = 1.5) AND user_inactive_reason = 0 AND user_type IN (3, 0) AND user_digest_type <> 'NONE' ORDER BY user_lang
As best I can tell, the extension did not add new table fields upon activation? Any assistance would be greatly appreciated.

Thanks.
-KP

User avatar
MarkDHamill
Registered User
Posts: 3310
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Wed May 31, 2017 2:00 am

Were there any errors reported when you updated digests? Did you follow the proper procedures of deactivating it first, removing all files, uploading the new ones and then enabling it again? When something like this happens it is likely other things didn't happen. Perhaps config values were not entered into the phpbb_config table, or modules that needed to be recorded were not recorded.

If everything appeared to go okay with the update, you can try adding the missing columns. Here are the columns for digests in the phpbb_users table, assuming MySQL or MariaDB is your database. You can use a tool like phpMyAdmin to add the missing one with the right properties.

Code: Select all

  `user_digest_attachments` tinyint(4) NOT NULL DEFAULT '1',
  `user_digest_block_images` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_filter_type` varchar(3) COLLATE utf8_bin NOT NULL DEFAULT 'ALL',
  `user_digest_format` varchar(4) COLLATE utf8_bin NOT NULL DEFAULT 'HTML',
  `user_digest_has_unsubscribed` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_last_sent` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `user_digest_max_display_words` int(4) NOT NULL DEFAULT '0',
  `user_digest_max_posts` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
  `user_digest_min_words` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
  `user_digest_new_posts_only` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_no_post_text` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_pm_mark_read` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_remove_foes` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_reset_lastvisit` tinyint(4) NOT NULL DEFAULT '1',
  `user_digest_send_hour_gmt` decimal(5,2) NOT NULL DEFAULT '0.00',
  `user_digest_send_on_no_posts` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_show_mine` tinyint(4) NOT NULL DEFAULT '1',
  `user_digest_show_pms` tinyint(4) NOT NULL DEFAULT '1',
  `user_digest_sortby` varchar(13) COLLATE utf8_bin NOT NULL DEFAULT 'board',
  `user_digest_toc` tinyint(4) NOT NULL DEFAULT '0',
  `user_digest_type` varchar(4) COLLATE utf8_bin NOT NULL DEFAULT 'NONE'
If it doesn't work the extension may have to be removed manually and you can try again. I'll reference a post I think earlier in this topic with these instructions if needed.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

platima
Registered User
Posts: 5
Joined: Wed Jan 11, 2017 2:09 am

Re: [RC] Digests 3.2.3-RC10

Post by platima » Wed May 31, 2017 8:56 am

Hi Mark,

No errors during the upgrade, and yep I followed that exact procedure as per your main post.

I ran

Code: Select all

ALTER TABLE `phpbbec_users` ADD `user_digest_send_hour_gmt` DECIMAL(5, 2) NOT NULL DEFAULT '0.00';       
ALTER TABLE `phpbbec_users` ADD `user_digest_type` VARCHAR(4) COLLATE utf8_bin NOT NULL DEFAULT 'NONE';
And now those errors are gone I'm getting

Code: Select all

Table 'lectech_phpb709.phpbbec_digests_subscribed_forums' doesn't exist [1146]
I think I'm just going to blow all the data away and try again.

Cheers
-KP

User avatar
MarkDHamill
Registered User
Posts: 3310
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Wed May 31, 2017 12:59 pm

Yes, it sounds like it got stuck in the database part of the upgrade.

To manually get rid of digests (this will remove all data, including any digest subscriptions):

- Delete the row for the extension from the phpbb_ext table.
- Delete any rows in the phpbb_config table where config_name like %digest%
- Delete columns in the phpbb_users table where the column name is like user_digest_%
- Delete any rows in the phpbb_migrations table where migration_name like %digest%
- Delete any rows in the phpbb_modules table where module_langname like %DIGEST%
- Make sure the /ext/phpbbservices/digests folder and files inside are removed
- Purge the cache

Then follow the regular installation procedures. After success, make sure you apply the code patch here.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

steveosonic
Registered User
Posts: 13
Joined: Thu Mar 16, 2017 9:54 am

Re: [RC] Digests 3.2.3-RC10

Post by steveosonic » Sun Jun 04, 2017 12:02 pm

MarkDHamill wrote:
Sat May 27, 2017 1:18 pm
I have a client that's a heavy user of digests that experienced the issue. I used his forum as a test bed. It took a lot of debugging and puzzling. Anyhow, these changes solved his problem so it should solve yours too.
Hi Mark - many thanks, and yes, issue solved! Thank you again for resolving this! Steve

dskdsk
Registered User
Posts: 2
Joined: Wed Jun 07, 2017 4:39 pm

Re: [RC] Digests 3.2.3-RC10

Post by dskdsk » Wed Jun 07, 2017 4:45 pm

many thanks for an essential addition to phpBB3.
I've a few confusions (which i accept may be completely mine and not those of Mark, the developer). All the same I post them here:

1. Extensions > Digests > Manually run the mailer > Run the mailer:
Evidently even if one has no intention of manually running the mailer, this option needs to be enabled or no mail will go out automatically.
(Admin log reports: A digest was NOT sent to … because user filters and preferences meant there was nothing to send’)
2. Extensions > Digests > User Default Setting
Evidently in the past, once could email post headings only (i.e. not the body of the post). Not clear how to enable this option with RC 10.
3. Extensions > Digests > User Default Settings >Maximum words to display in a post
mention is made of “Show no post text at all” and yet i cannot find any such setting.

User avatar
MarkDHamill
Registered User
Posts: 3310
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Wed Jun 07, 2017 10:05 pm

"Manually run the mailer" is simply a testing tool, one I had to build in so I could develop and test digests and which I knew would be useful to everyone. It helps in setting up digests to first verify they can be sent manually, and it aids as a troubleshooting tool so if users report issues you can rerun a particular hour, send all digests for the hour to your email address to look at them, or send them to a cache folder for inspection. Digests are normally sent out when there is forum traffic via a phpBB cron. Procedures for testing digests manually and options for using the cron method are in the first post of this topic.

You could remove the manual mailer from the ACP on the System tab and digests would still go out as evidenced by the Admin log. There's no point in doing this however as only administrators can access the ACP.

Thanks for pointing out that User digest defaults is not providing a way to default the "Show no post text at all" option. This will be fixed in the next version. The option does exist in the User control panel for digests, under Additional criteria, for a subscriber to select this option.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

dskdsk
Registered User
Posts: 2
Joined: Wed Jun 07, 2017 4:39 pm

Re: [RC] Digests 3.2.3-RC10

Post by dskdsk » Wed Jun 07, 2017 10:29 pm

Thank you Mark. I suspect the behaviour i saw with respect to automated mail not going out until i checked 'Run the mailer' was purely coincidental. I will uncheck that option and confirm that automated digests are sent as expected. (Note: the concept and implementation behind 'Manual Email' is brilliant and indispensable. Thank you.)

I am also very keen on the load balancer you built. Nice stuff.

Will keep my eyes out for RC 11 as we would like to set the digest default to 'no text'.

Thanks again for your tool and help. ciao, dk

User avatar
MarkDHamill
Registered User
Posts: 3310
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Thu Jun 08, 2017 1:54 pm

Setting the default for showing post text to no does not mean a subscriber can't change it to yes. If auto subscriptions are enabled, it means it will be set this way unless a subscriber overrides it.

In short, it doesn't set a global policy.

Basically in the last release I took up the suggestion from a translator that user digest defaults should use the same wording as on the digests user control panel. Something got lost, and that was the explanation text for Maximum words to display in a post for digest defaults. It should read: "Set to -1 to show the full post text by default. Setting at zero (0) means by default the user will see no post text at all." The logic of this text should work, so if you set this value to 0 then "Show no post text at all" will be checked by default when an automatic subscriptions is created. And the first time such a subscriber goes into the User Control Panel this should be checked too. It can always be overwritten by the subscriber.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16437
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by DavidIQ » Thu Jul 27, 2017 12:57 am

FYI a client of mine running 3.2.1 (3.2.0 was also having this problem) is having this reported in their error logs a crap ton of times:

Code: Select all

Error while creating image
» Error in [ROOT]/phpbb/user.php on line 619: DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given
Saw some reference in a previous post to a bug in the core. Is there a bug we need to look at fixing in the core?
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
MarkDHamill
Registered User
Posts: 3310
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Fri Jul 28, 2017 12:49 am

Version 3.2.3 fixes this issue. However you must make these changes.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

BigRed01
Registered User
Posts: 450
Joined: Mon Jan 24, 2005 9:26 am
Location: The upper midwest

Re: [RC] Digests 3.2.3-RC10

Post by BigRed01 » Sun Jul 30, 2017 7:38 pm

I'm a total newb at cron jobs

Image

Code: Select all

curl -A=Mozilla/4.0 http://www.****.com/forum/ext/phpbbservices/digests/task/digests.php?cron_type=cron.task.cron_task

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: Baidu [Spider], gio73 and 19 guests