mozzy
(Moses Mutesasira)
April 28, 2020, 11:15am
1
I was testing out the Attachments module , it couldn’t load an image that has been uploaded out side the Attachments API ,say directly via Complex Obs API ,
say if i create a Complex Obs via the Rest API ,like here
or if i Upload an image using the Manage Observation page on the Legacy UI
1 Like
mksd
(Dimitri R)
April 28, 2020, 12:21pm
2
What do you mean by “couldn’t load” ?
mozzy
(Moses Mutesasira)
April 28, 2020, 12:24pm
3
the image is displayed as any file ,Actually it could throw errors
mksd
(Dimitri R)
April 28, 2020, 12:47pm
4
Are @reagan or yourself able to analyse the logs or do some debugging to see what goes wrong with the handlers?
2 Likes
mozzy
(Moses Mutesasira)
April 28, 2020, 1:20pm
5
I have reproduced the bug again on the qa-server.
I uploaded one image from the Attachments page ,
I uploaded the second image on the Legacy Observation Management page ,
i used the same concept ATT IMAGE ATTACHMENT ,
but the second image fails in the attachment widget.
@reagan ,you can go ahead create a ticket for this , we shall investage a little more
1 Like
reagan
(Reagan patrick Makoba)
April 28, 2020, 1:40pm
6
1 Like
reagan
(Reagan patrick Makoba)
April 28, 2020, 1:52pm
7
Will look into it and see.
1 Like
mksd
(Dimitri R)
April 28, 2020, 3:07pm
8
@mozzy could you fill the ‘2. Steps to reproduce’ section of the description on ATT-39 ?
It seems that you had a REST call ready to paste?
2 Likes
mksd
(Dimitri R)
April 28, 2020, 5:36pm
10
Ah no sorry you did this:
I uploaded the second image on the Legacy Observation Management page
Just detail those steps.
But actually it should be possible to create a Spring test that reproduce this error, that would be the best foundation to work on this.
mksd
(Dimitri R)
April 29, 2020, 9:55am
11
Thanks @mozzy .
Anyone of you two (@mozzy , @reagan ) willing to pick up ATT-39 ?
If yes, the first step will be to write a failing Spring test for it.
2 Likes
gcliff
(CLIFF GITA)
April 29, 2020, 3:27pm
12
hello @mksd @mozzy @reagan
i have been going through this thread and i upload images to the attachment widget from the manage observation in the legacy ui .
Though on clicking the Save Observation
button in the manage obs section under legacy ui the images are attached to the widget but the server throws an error .
gcliff
(CLIFF GITA)
April 29, 2020, 3:49pm
13
i used the ATT IMAGE ATTACHMENT
concept of complex datatype and did use it to create a complex obs in manage observations in legacy ui
gcliff
(CLIFF GITA)
May 5, 2020, 7:50am
14
gcliff:
i have been going through this thread and i upload images to the attachment widget from the manage observation in the legacy ui .
Though on clicking the Save Observation
button in the manage obs section under legacy ui the images are attached to the widget but the server throws an error .
i
i was able to reproduce the above error that @mozzy reported when i selected handlers which are not from the attachment module
mksd
(Dimitri R)
May 5, 2020, 8:03am
15
Thanks a lot @gcliff , the log is really useful. For info what this says:
AbstractMethodError:
ImageAttachmentHandler.supportsView(Ljava/lang/String;)Z
is that ImageAttachmentHandler#supportsView(String)
does not exist, which is true. It’s the appended “Z
” that says that the method is not found.
Turns out that this will be fixed as part of ATT-38 . Just waiting for @reagan to merge my PR to his repo.
The upcoming fix is here actually. In plain English: AbstractAttachmentHandler#supportsView(String view)
was added, so all “Attachments handlers” (those that extend AbstractAttachmentHandler
) will expose that method.
Would be great if you could test again once ATT-38 is merged.
1 Like
mksd
(Dimitri R)
May 5, 2020, 8:18am
16
@gcliff it was merged, see here on ATT-38 .
1 Like
gcliff
(CLIFF GITA)
May 5, 2020, 8:23am
17
let me test it out with the new changes
1 Like
reagan
(Reagan patrick Makoba)
May 5, 2020, 8:26am
18
@mksd your spot on right…figured your changes in the AbstractAttachmentHandler bean https://github.com/reagan-meant/openmrs-module-attachments/pull/1/files#diff-493f0a3d8c5aa07953f4b231373443d1R79 will fix it because it seems like everything was working out well before ATT-33. will test it out shortly.
gcliff
(CLIFF GITA)
May 5, 2020, 8:36am
19
@mksd @reagan i cant compile after pulling the latest changes https://pastebin.com/8AuZcxki
1 Like
mksd
(Dimitri R)
May 5, 2020, 8:40am
20
There’s actually an error reported by Travis here . Looking into it.
2 Likes