GNU bug report logs - #36520
Form submition in eww doesn't work if file field is left empty

Previous Next

Package: emacs;

Reported by: Ivaylo Ilionov <ivaylo.ilionov <at> outlook.com>

Date: Sat, 6 Jul 2019 11:29:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivaylo Ilionov <ivaylo.ilionov <at> outlook.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Form submition in eww doesn't work if file field is left empty
Date: Sat, 6 Jul 2019 10:39:41 +0000
[Message part 1 (text/plain, inline)]
When submitting form with various fields including one optional
field for file upload, if the file filed is left empty - the
submition doesn't work.

The error is: Wrong type argument: stringp, nil

I've tracked the problem to the function 'eww-submit' which tries
to open a file for upload (the file was never initialized by the
html form).

My fix is to check if the property is set in the file "eww.el.gz" after
line 1435:

> ((equal (plist-get input :type) "file")
>  ;; FIX check if property :filename is not nil
>  (when (not (null (plist-get input :filename)))
>    (push (cons "file"
>         (list (cons "filedata"
>       (with-temp-buffer
>         (insert-file-contents
>          (plist-get input :filename))
>         (buffer-string)))
>        (cons "name" (plist-get input :name))
>        (cons "filename" (plist-get input :filename))))
>   values)))

Details about my emacs:

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32)
 of 2019-07-05 built on debian
Repository revision: f24d47359d9b6621215f20795d585c5024d91783
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.