easydigitaldownloads/Easy-Digital-Downloads — pull request #1699 by sumobi (2013-11-13 02:05:00+00:00)
Title: Set user ID to -1 (guest) if does not exist

I believe this is related to the download limit bug.

WP 3.7.1
Tested with: EDD github master, 1.8.3.1 stable and 1.8.2

Making a purchase as a guest (ie not creating an account at checkout) and then clicking the link of the download on the purchase confirmation page, results in the errors below, which repeat on different line numbers.

A var_dump of $user_info inside the edd_record_download_in_log() function reveals that the ID does not exist as per the first error below. Patch sets guest to -1 if it does not exist.

`Notice: Undefined index: id in /wp-content/plugins/easy-digital-downloads/includes/download-functions.php on line 434`

`Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/easy-digital-downloads/includes/download-functions.php:434) in /wp-content/plugins/easy-digital-downloads/includes/process-download.php on line 84`

`Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/easy-digital-downloads/includes/download-functions.php:434) in /wp-content/plugins/easy-digital-downloads/includes/process-download.php on line 146`