File Upload Error – AjaxHandler.php – Undefined index: file_id
-
Hi, I’ve been using download monitor for a couple of years and it’s worked well. Currently installed is 4.7.78 (auto updates on).
I’m currently unable to upload any files. The files *do* make it to the underlying file system on the server, but “ERROR” is displayed on the page in the browser and the following is recorded in debug.log:
PHP Notice: Undefined index: file_id in /var/www/[site]/wp-content/plugins/download-monitor/src/AjaxHandler.php on line 322
The error comes from this line in public function save_attachment_meta():
update_post_meta( absint( $_POST['file_id'] ), 'dlm_download', $meta );
After an unsuccessful update, the following are stored in relation to the download:
mysql> SELECT * FROM wp_postmeta WHERE post_id = 10867;
+---------+---------+-----------+------------+
| meta_id | post_id | meta_key | meta_value |
+---------+---------+-----------+------------+
| 34768 | 10867 | _version | NULL |
| 34769 | 10867 | _files | [] |
| 34770 | 10867 | _filesize | -1 |
| 34771 | 10867 | _md5 | |
| 34772 | 10867 | _sha1 | |
| 34773 | 10867 | _sha256 | |
| 34774 | 10867 | _crc32 | |
+---------+---------+-----------+------------+This looks quite different from that stored about earlier uploads:
mysql> SELECT * FROM wp_postmeta WHERE post_id = 10388;
+---------+---------+-----------------------+--------------------------+
| meta_id | post_id | meta_key | meta_value |
+---------+---------+-----------------------+--------------------------+
| 33446 | 10388 | _edit_lock | 1625778656:1 |
| 33454 | 10388 | _edit_last | 1 |
| 33457 | 10388 | _featured | no |
| 33458 | 10388 | _members_only | no |
| 33459 | 10388 | _redirect_only | no |
| 33460 | 10388 | _download_count | 55 |
| 33560 | 10388 | _graphene_post_images | a:1:{s:7:"300x300";b:0;} |
+---------+---------+-----------------------+--------------------------+The last SQL query before it fails seems to be this:
SELECT autoload FROM wp_options WHERE option_name = '_transient_dlm_file_version_ids_10865'
Any help greatly appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘File Upload Error – AjaxHandler.php – Undefined index: file_id’ is closed to new replies.