Bug 421508

Summary: Cannot type anything in some form fields
Product: [Applications] okular Reporter: Simone Gaiarin <simgunz>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, nate, yurchor
Priority: NOR    
Version: 20.04.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In: 1.10.3
Sentry Crash Report:
Attachments: test pdf

Description Simone Gaiarin 2020-05-14 11:50:38 UTC
Created attachment 128448 [details]
test pdf

SUMMARY
Some form fields are not fillable in Okular, but work correctly in other pdf viewers as Foxit reader.

STEPS TO REPRODUCE
1. Click "Show forms"
2. Try to fill the fields "CELLULARE" or "TELEFONO"

OBSERVED RESULT
Cannot type anything


EXPECTED RESULT
Be able to fill in the field

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2
Kernel Version: 5.4.39-1-MANJARO
OS Type: 64-bit
Comment 1 Yuri Chornoivan 2020-05-14 11:59:52 UTC
Confirmed with the latest poppler (0.88) and Okular from git.
Comment 2 Albert Astals Cid 2020-05-16 11:01:04 UTC
my guess without having had a look at the file, there's probably a JS validator that we're not doing properly.
Comment 4 Albert Astals Cid 2020-06-15 21:39:21 UTC
Git commit d78cbb79c98e01fc524ec91fb099ec8ff98cc1fa by Albert Astals Cid.
Committed on 15/06/2020 at 20:45.
Pushed by aacid into branch 'release/20.04'.

Fix/Workaround file where we can't enter values in some fields

The problem was that the JS checker for the field format was using the
willCommit property of event and we don't define it so the JS
interpreter was going "ok nope, out of here" and the field didn't get edited.

I've read the willCommit definition in js_api_reference.pdf for almost
30 minutes, and even it's just 3 lines i don't think i understand it,
but i think that returning true is "safer", i.e. says that this event is
going to actually change the field, which as far as i can see it's what
we always do

M  +8    -0    core/script/kjs_event.cpp

https://invent.kde.org/graphics/okular/commit/d78cbb79c98e01fc524ec91fb099ec8ff98cc1fa