madfitz

  • Elite Class Non Coder
  • Posts: 97
Birthdays
« on February 15th, 2014, 07:09 PM »
I initiated a birthday email. The email was sent with the subject line the content was blank :hmm:

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Birthdays
« Reply #1, on February 16th, 2014, 08:03 PM »
I can reproduce this by setting up a member with birthday = today and manually running the 'Birthday Processing' task.

There is also an error on the set-up screen. If you click the (?) next to the 'Birthday Message to use' label you get a pop-up. Within that pop-up is a link 'Scheduled Tasks' which points to http://www.domain.tld/%1$s?action=admin;area=scheduledtasks;%2$s  - click on this and get the error:
Quote
Bad Request
Your browser sent a request that this server could not understand.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Birthdays
« Reply #2, on February 16th, 2014, 08:18 PM »
Looking into this.
Posted: February 16th, 2014, 08:17 PM

Look easy enough to fix.
In Birthday-Scheduled.php, at line 79, replace $emaildata['body'] with $body -- and tell me if this works better. ;)
Re: Birthdays
« Reply #3, on February 16th, 2014, 08:31 PM »
Regarding the other problem...

The birthday_email help popup uses a link with two entries that must be treated with a sprintf() call to replace the URL with the current one. It's silly.

I remember removing this feature long ago because it didn't make sense to do a sprintf on a feature used only a couple of times in SMF, so I removed it all, and removed the links. $txt['help_xmlnews_enable'] in German still has a link (Pandos, did you translate this file from scratch or did you take it from SMF...? Because this was removed so long ago..? Not that I'm judging!), and the Birthday plugin also still has it, I'm afraid.

The simple fix is to remove the link, ah ah... Or just replace the first % with <URL>, and remove the second because it's not used.

Pandos

  • Living on the edge of Wedge
  • Posts: 635
Re: Birthdays
« Reply #4, on February 16th, 2014, 08:34 PM »
It's translated from scratch!
And only from files that are in the repo.
# dpkg-reconfigure brain
error: brain is not installed or configured

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Birthdays
« Reply #5, on February 16th, 2014, 08:34 PM »
Yes that has corrected it and the email body matches what's in the admin.

However, and I apologise I didn't notice before, there is a message in the admin error log:
Quote
Type of error: Birthdays
http://wedge.foc-u.co.uk/index.php?action=admin;area=scheduledtasks
8: Undefined index: regards_team
/home/gareth/wedge/plugins/birthday/Birthday-Scheduled.php
Line: 64
Regarding the 'bad request' removing the help link seems sensible.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Birthdays
« Reply #6, on February 16th, 2014, 10:02 PM »
@Pandos, why is it that this link (which hasn't been in the Wedge English files for probably years) is also using the old action name..? (action=.xml, instead of action=feed, also renamed years ago.)

Again, I don't mind AT ALL if you took the original SMF and adapted them to Wedge. Seriously, it's how I would have done it, because it's such a huge amount of work for just one person. I spent 4 weeks retranslating SMF in French back in 2010, and even then I was just re-reading the existing translation and fixing errors here and there, and even now I still discover errors in the old translation. I don't know how you managed to do it.

@Farjo, this doesn't make sense to me... That string is in EmailTemplates.english.php, and the plugin DOES load that file (loadLanguage('EmailTemplates'), line 23)... Any ideas?

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Birthdays
« Reply #7, on February 16th, 2014, 10:24 PM »
Maybe I do not have the correct version - it's difficult to keep up 'on the road'. Later this week I may have the WiFi connection to be able to re-install from scratch and will test again.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Birthdays
« Reply #8, on February 16th, 2014, 10:42 PM »
That string has been in EmailTemplates for a long time, and certainly before Wedge went public, so it would be surprising that it's a problem with file versions...
Just make sure all language files are where they should be, really... ;)

Maybe a problem with the UK version, I don't know..? I know EmailTemplates is a 'special' language file, so...

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Birthdays
« Reply #9, on February 17th, 2014, 01:17 AM »
I changed the birthday to the next day and at midnight received an email with no error in the log. However when I manually ran the task I got the error again.

ps this install is not using the uk language files.

madfitz

  • Elite Class Non Coder
  • Posts: 97
Re: Birthdays
« Reply #10, on February 17th, 2014, 11:36 AM »
I sent out an email successfully but the 'regards' line read:
Quote
Regards,
The {FORUMNAME} Team.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Birthdays
« Reply #11, on February 17th, 2014, 01:33 PM »
At line 62, try replacing the array with:

Code: [Select]
$replacements = array(
'{REGARDS}' => $txt['regards_team'],
'{FORUMNAME}' => $mbname,
'{SCRIPTURL}' => SCRIPT,
);

Keep me posted!
Posted: February 17th, 2014, 11:55 AM

It probably won't work, I just looked an it's a strtr, so it won't replace stuff that has already been touched.
So, it'll probably have to be:

Code: [Select]
$replacements = array(
'{FORUMNAME}' => $mbname,
'{SCRIPTURL}' => SCRIPT,
'{REGARDS}' => str_replace('{FORUMNAME}', $mbname, $txt['regards_team']),
);

Still, if you could try the first one, that would be nice...

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Birthdays
« Reply #12, on February 17th, 2014, 01:37 PM »
I am flying home today so have little time. Have updated the file with the first fix and purged but same result - perhaps in my hurry I have cocked something up? Sorry will have to leave this now until tomorrow or Wednesday.

madfitz

  • Elite Class Non Coder
  • Posts: 97
Re: Birthdays
« Reply #13, on February 17th, 2014, 10:48 PM »
I've created a new user who will be celebrating his birthday tomorrow. I'll let you know what fix #2 brings him!

Bunstonious

  • Espada
  • Posts: 204
Re: Birthdays
« Reply #14, on February 17th, 2014, 10:55 PM »
Quote from madfitz on February 17th, 2014, 10:48 PM
I've created a new user who will be celebrating his birthday tomorrow. I'll let you know what fix #2 brings him!
Presents? :D
Quote from Random Guy
Not putting miles on your Ferrari is like not having sex with your Girlfriend so she'll be more desirable to her next Boyfriend