[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!
Scam Warning
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)
bonnaphil
Registered User
Posts: 3
Joined: Tue Jan 03, 2017 2:21 am
Location: Toulon - France
Name: Philippe Bonnaure
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by bonnaphil » Tue May 16, 2017 11:43 pm

The French version is also ready for Digests 3.2.3-RC10 : You may find it here on GitHub or for a direct download on my server here.
Philippe Bonnaure
macvf.fr - GitHub - phpBB Forum

User avatar
MarkDHamill
Registered User
Posts: 3325
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 17, 2017 11:55 pm

One bug in version 3.2.3, line 289 in /cron/task/digests.php is:

Code: Select all

			if (!in_array($this->path_prefix . 'includes/functions_content.' . $this->phpEx, get_included_files()))
and should be:

Code: Select all

			if (!function_exists('censor_text'))
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 » Thu May 18, 2017 7:42 am

Thanks Mark for the latest release candidate, since being installed the mails are flowing again nicely, I will keep an eye out over the next week.

Have also included the patch in the prior post.

Thank you again.

stevenospam
Registered User
Posts: 41
Joined: Thu Dec 15, 2011 2:02 am

Re: [RC] Digests 3.2.3-RC10

Post by stevenospam » Tue May 23, 2017 1:43 pm

Hi Mark,
I disabled Digests on my phpbb 3.2 forum, deleted the 3.2.0 digests code, unpacked the 3.2.3 code, copied it to its extension directory, added the latest fix and enabled digests. The log shows digests running every hour but my error log shows this message:
Anonymous 208.117.46.29 Tue May 23, 2017 8:00 am Error while creating image
» Error in [ROOT]/phpbb/user.php on line 599: DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given

No digests are being mailed even though some of us should get a mailing even when there is nothing to mail.

Any ideas?

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

Re: [RC] Digests 3.2.3-RC10

Post by steveosonic » Wed May 24, 2017 7:58 am

I've been getting the same message for some time,

Code: Select all

Error while creating image
» Error in [ROOT]/phpbb/user.php on line 599: DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given
I have 10 pages of logs of this error generated in the last week.

It does stop digests from being sent.

Happy to help in anyway I can.

User avatar
MarkDHamill
Registered User
Posts: 3325
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 24, 2017 3:51 pm

See this post. What results do you get?
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
MarkDHamill
Registered User
Posts: 3325
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 24, 2017 6:29 pm

Previous content deleted.
Last edited by MarkDHamill on Fri May 26, 2017 11:09 pm, edited 1 time in total.
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 » Thu May 25, 2017 6:00 am

Thank you Mark ... I've updated and will report back :)

stevenospam
Registered User
Posts: 41
Joined: Thu Dec 15, 2011 2:02 am

Re: [RC] Digests 3.2.3-RC10

Post by stevenospam » Thu May 25, 2017 11:59 am

I dropped back to version 3.2.0 because my board is active right now and is an important communication tool for an issue my users are addressing in their community. I'll wait for traffic to die down and then update again.

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

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Fri May 26, 2017 11:45 pm

Actually, I deleted the suggested corrections.

I know what the issue is but I haven't figured out how to fix it yet. It happens when a regular phpBB cron is run using "Anonymous", i.e. it is triggered by guests hitting the forum. It seems that after sending one or two digests, the Timezone error occurs:
Error in [ROOT]/phpbb/user.php on line 599: DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given
The error occurs here on line 599 of /phpbb/user.php:

Code: Select all

		$time->setTimezone($this->timezone);
So $this->timezone must not be a PHP DateTime object somehow. Most likely the object does not exist although it should exist because Anonymous does have user_timezone set to UTC.

I have tried testing to see if it's an object before called $user->format_date() and if not creating it but it's not working or I'm doing something wrong.

Unfortunately, this is devilishly hard to debug. I have to write admin log entries and I have to run a phpBB cron as Anonymous. No surprise this missed testing.
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
MarkDHamill
Registered User
Posts: 3325
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » Sat May 27, 2017 2:27 am

Here's the real fix to the timezone issue. It was introduced in attempt to make month abbreviations and days of the week language independent by using $user->format_date. It's just that for some reason a timezone object attached to the user object seems to get lost for the guest account when it triggers a phpBB cron. It seems one or two may get out, but that's it.

In /cron/task/digests.php before line 866:

Code: Select all

			$publish_date = $this->language->lang('DIGESTS_PUBLISH_DATE', $row['username'], $this->user->format_date($recipient_time, $row['user_dateformat']));
add:

Code: Select all

			if (!is_object($this->user->timezone))
			{
				$this->user->timezone = new \DateTimeZone($this->config['board_timezone']);
			}
before line 1319:

Code: Select all

				$message_datetime = $this->user->format_date($recipient_time, $user_row['user_timezone']);
add:

Code: Select all

				if (!is_object($this->user->timezone))
				{
					$this->user->timezone = new \DateTimeZone($this->config['board_timezone']);
				}
and before line 1943:

Code: Select all

				$post_datetime = $this->user->format_date($recipient_time, $user_row['user_dateformat']);
add:

Code: Select all

				if (!is_object($this->user->timezone))
				{
					$this->user->timezone = new \DateTimeZone($this->config['board_timezone']);
				}
You may need to clear the cron lock with SQL similar to this:

update phpbb_config set config_value = 0 where config_name = 'cron_lock'

then purge the cache.
Last edited by MarkDHamill on Mon May 29, 2017 3:22 pm, edited 1 time in total.
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 » Sat May 27, 2017 10:26 am

Looks more promising Mark ... thank you ... on saving the updated files a bunch of emails got sent out.

Cron seems to be okay, so I'll leave it be.

Thank you for your resolve in sorting this out ... will report back in a few days.

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

Re: [RC] Digests 3.2.3-RC10

Post by MarkDHamill » 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.
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: 1186
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:37 am

MarkDHamill wrote:
Sat May 27, 2017 2:27 am
It's just that for some reason a timezone object attached to the user object seems to get lost for the guest account
The guest account has no timezone assigned. I had similar issues in my extension and solved it by picking up the board's timezone for the guest account. See https://github.com/canonknipser/viewexi ... hp#L81-L93 as an example ;)
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: 3325
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 3:19 pm

Thank you. Curiously neither the guest account (Anonymous) nor the default admin account have a default timezone set when a board in installed. On the latter, I've had a bug report on this which has not been addressed.

Since this is true I changed my patch code to default to the board_timezone instead.
Last edited by MarkDHamill on Sun Jun 18, 2017 1:03 am, edited 1 time in total.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: dmzx, gio73, RomaamoR, van de werde and 31 guests

cron