Skip to content

Conversation

@mattmelling
Copy link
Contributor

#1862, #1863

If date fields are not set when ADIF export form is submitted, the dates are submitted as empty strings.

E.g. under Firefox on my system:

-----------------------------258695364640644243403098313945
Content-Disposition: form-data; name="station_profile"

2
-----------------------------258695364640644243403098313945
Content-Disposition: form-data; name="from"


-----------------------------258695364640644243403098313945
Content-Disposition: form-data; name="to"


-----------------------------258695364640644243403098313945--

Adif_data->export_custom was previously checking if $from, $to != 0 which in this case is true, but then the blank string is passed through to DateTime::createFormat and interpreted as a truthy value, which causes the error referenced above.

This now works for me when exporting all QSOs to ADIF under PHP8.

@AndreasK79
Copy link
Contributor

Tested working ok here. Thanks.

@AndreasK79 AndreasK79 merged commit 3c4f50d into magicbug:dev Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants