Fix bug with missing output for vectors in R backend
ClosedPublic

Authored by sirgienko on May 20 2018, 12:35 PM.

Details

Reviewers
asemke
Summary

Add support for "application/x-extension-html" mimetype in R expression, because some systems use this mimetype for html, instead of "text/html"

BUG: 394018
FIXED-IN: 18.04.2

Diff Detail

Repository
R55 Cantor
Branch
r-backend-another-html-mimetype-support
Lint
No Linters Available
Unit
No Unit Test Coverage
sirgienko created this revision.May 20 2018, 12:35 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptMay 20 2018, 12:35 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sirgienko requested review of this revision.May 20 2018, 12:35 PM

@asemke, Could you verify, that this commit don't breaks vector output for you? My system use mime application/x-extension-html for html, so I can't check, that after this commit R expression still can work with mime text/html.

@asemke, Could you verify, that this commit don't breaks vector output for you? My system use mime application/x-extension-html for html, so I can't check, that after this commit R expression still can work with mime text/html.

No, this breaks the output for me:

What is the mime type for the generated files on your system? What does 'file' shows for the generated html files? For me it is:

alex@notebook:~/Projekte/cantor/build_debug (arcpatch-D12998 $%)>file /tmp/cantor_rserver-8561/Rtable0.html 
/tmp/cantor_rserver-8561/Rtable0.html: HTML document, ASCII text, with no line terminators

No, this breaks the output for me:

Could you add log from console for this entry?

What is the mime type for the generated files on your system? What does 'file' shows for the generated html files? For me it is:

alex@notebook:~/Projekte/cantor/build_debug (arcpatch-D12998 $%)>file /tmp/cantor_rserver-8561/Rtable0.html 
/tmp/cantor_rserver-8561/Rtable0.html: HTML document, ASCII text, with no line terminators
mmmm1998:/tmp/cantor_rserver-19234
[16:19:25]$ file Rtable3.html 
Rtable3.html: HTML document, ASCII text, with no line terminators

Very intresting:

[16:25:08]$ mimetype /tmp/cantor_rserver-19234/Rtable3.html
/tmp/cantor_rserver-19234/Rtable3.html: text/html

but in log there is another mimetype

showing files:  ("/tmp/cantor_rserver-19234/Rtable3.html")
MimeType:  "application/x-extension-html"

@asemke, which Qt version do you have? My version is 5.9.5.

No, this breaks the output for me:

Could you add log from console for this entry?

showing files:  ("/tmp/cantor_rserver-8561/Rtable1.html")
MimeType:  "text/html" its a HTML document
content:  "<table border=\"1\" align=\"center\" valign=\"center\"><tr><td bgcolor=\"#AAAAAA\">[1]</td><td>1</td><td>2</td><td>3</td></tr><table>"
settting result to a type  1
result update Entry

Very intresting:

[16:25:08]$ mimetype /tmp/cantor_rserver-19234/Rtable3.html
/tmp/cantor_rserver-19234/Rtable3.html: text/html

but in log there is another mimetype

showing files:  ("/tmp/cantor_rserver-19234/Rtable3.html")
MimeType:  "application/x-extension-html"

@asemke, which Qt version do you have? My version is 5.9.5.

I have

alex@notebook:~/Projekte/cantor/build_debug (arcpatch-D12998 $%)>file --mime-type /tmp/cantor_rserver-8561/Rtable1.html 
/tmp/cantor_rserver-8561/Rtable1.html: text/html

and

showing files:  ("/tmp/cantor_rserver-8561/Rtable1.html")
MimeType:  "text/html"

with Qt 5.10.

sirgienko updated this revision to Diff 34533.May 20 2018, 2:36 PM

@asemke, Could you test R backend with this update?

@asemke, Could you test R backend with this update?

yes, this works.

For me it is also sufficient to check in rexpression.cpp:106 for type.inherits(QLatin1String("text/plain")) only - application/x-extension-html inherits apparently from text/plain.

For me it is also sufficient to check in rexpression.cpp:106 for type.inherits(QLatin1String("text/plain")) only - application/x-extension-html inherits apparently from text/plain.

Your system, as I see, doesn't use application/x_extension-html (uses text/html instead), so you can remove condition for this mimetype without problem.
But removing this condition for me gives:
cannot open file /tmp/cantor_rserver-14014/Rtable1.html: Unknown MimeType

asemke accepted this revision.May 20 2018, 3:20 PM

For me it is also sufficient to check in rexpression.cpp:106 for type.inherits(QLatin1String("text/plain")) only - application/x-extension-html inherits apparently from text/plain.

Your system, as I see, doesn't use application/x_extension-html (uses text/html instead), so you can remove condition for this mimetype without problem.
But removing this condition for me gives:
cannot open file /tmp/cantor_rserver-14014/Rtable1.html: Unknown MimeType

This would mean that application/x-extension-hmtl doesn't inherit from text/plain... Ok. Let's submit this. bool isHtml in line 110 can be defined const.

This revision is now accepted and ready to land.May 20 2018, 3:20 PM
sirgienko updated this revision to Diff 34537.May 20 2018, 3:23 PM

Make isHtml const.

sirgienko closed this revision.May 20 2018, 3:27 PM