From: Ivaylo Ilionov <ivaylo.ilionov@outlook.com>
To: 36520@debbugs.gnu.org
Subject: bug#36520: Form submition in eww doesn't work if file field is left empty
Date: Sat, 6 Jul 2019 10:39:41 +0000 [thread overview]
Message-ID: <VE1PR08MB513653BD4614A51CADF8E27C82F40@VE1PR08MB5136.eurprd08.prod.outlook.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]
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)
[-- Attachment #2: Type: text/html, Size: 2431 bytes --]
next reply other threads:[~2019-07-06 10:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-06 10:39 Ivaylo Ilionov [this message]
2019-07-07 16:38 ` bug#36520: Form submition in eww doesn't work if file field is left empty Basil L. Contovounesios
2019-07-07 20:57 ` Ivaylo Ilionov
2019-09-14 14:55 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VE1PR08MB513653BD4614A51CADF8E27C82F40@VE1PR08MB5136.eurprd08.prod.outlook.com \
--to=ivaylo.ilionov@outlook.com \
--cc=36520@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.