all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#36520: Form submition in eww doesn't work if file field is left empty
@ 2019-07-06 10:39 Ivaylo Ilionov
  2019-07-07 16:38 ` Basil L. Contovounesios
  0 siblings, 1 reply; 4+ messages in thread
From: Ivaylo Ilionov @ 2019-07-06 10:39 UTC (permalink / raw)
  To: 36520

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-14 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-06 10:39 bug#36520: Form submition in eww doesn't work if file field is left empty Ivaylo Ilionov
2019-07-07 16:38 ` Basil L. Contovounesios
2019-07-07 20:57   ` Ivaylo Ilionov
2019-09-14 14:55   ` Lars Ingebrigtsen

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.