I have a setup with Email-Before-Download and Contact-Form-7. Everything works fine except that some files do not show up as attachment. About 4 out of 16 files are affected.
Through comparison and renaming I excluded as possible cause:
– file size
– file type (all pdf)
– special characters in filename
– length of filename
Any ideas about the cause and how to further debug this?
The page I need help with: [log in to see the link]
Another insight: when logging the outgoing mails with plugin WP Mail Logging https://wordpress.org/plugins/wp-mail-logging/ I can see that in case of an error the attachment is tried to be read from a wrong location:
instead of where it is really saved:
Some fallback to the beginning of unix calculation of times at work, I guess.
Getting closer: there is a line
$fileDate = date('Y/m', strtotime($fileDate));converting a date string to a part of file path.
Printed the variable before and after, and from the debug.log I can see:
16. Mai 2019 converts to 1970/01
13. September 2018 converts to 2018/09
Both date strings are German, but the second one is identical to English. So the date strings that are different in German cause the error.
The php function only accepts english date strings, see https://www.php.net/manual/en/function.strtotime.php
Thank you, plugin developers.
Don’t ask for my workaround. It’s ugly. It works. Still thinking about a proper fix.
- The topic ‘Erratic attachments’ is closed to new replies.