Bug Hunting Session
Bug 92553 - Web Wizard: Not open FTP Configure on Web Wizard Preview Setting.
Summary: Web Wizard: Not open FTP Configure on Web Wizard Preview Setting.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.2.2 release
Hardware: Other All
: high major
Assignee: Julien Nabet
URL:
Whiteboard: target:5.1.0 target:5.0.3
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-05 11:25 UTC by sawakaze
Modified: 2016-10-25 19:20 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
this is web page ftp configure button on web wizard. (20.93 KB, image/png)
2015-07-05 11:25 UTC, sawakaze
Details
dirty patch (3.78 KB, text/plain)
2015-09-23 22:04 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sawakaze 2015-07-05 11:25:54 UTC
Created attachment 117059 [details]
this is web page ftp configure button on web wizard.

Hi

When press configure button on Web Wizard Preview Setting, Not response.
(Configure Button is attachment) 

Therefore, Now Web Wizard is unable to publish ftp site.

I confirm on two environments.

(1) LO 4.4.2 and Linux x64
Version: 4.4.2.2
Build ID: c4c7d32d0d49397cad38d62472b0bc8acff48dd6
Locale: ja_JP

(2) LO 5 and Windows 10 x64
Version: 5.1.0.0.alpha1+ (x64)
Build ID: 8b788891796ff0571f779cdbe8ce809c35c42754
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2015-07-02_23:09:27
Locale: ja-JP (ja_JP)

Regards,
Sawakaze
Comment 1 Julien Nabet 2015-07-05 11:54:58 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_General.py", line 88, in getFTPDialog
    self.ftpDialog = FTPDialog(self.xMSF, pub, self.oWizardResource)
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialog.py", line 112, in __init__
    self.resources = FTPDialogResources(oWizardResource)
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialogResources.py", line 24, in __init__
    super(FTPDialogResources, self).__init__(xmsf, self.MODULE_NAME)
NameError: global name 'xmsf' is not defined
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_Events.py", line 447, in showFTPDialog
    return self.getFTPDialog(pub).execute(self) == 1
Comment 2 Julien Nabet 2015-07-05 15:45:25 UTC
Xisco/Javier: 
There are several pbs here.
1) 
I could fix the first one (see my previous comment) with this patch:
diff --git a/wizards/com/sun/star/wizards/web/FTPDialogResources.py b/wizards/com/sun/star/wizards/web/FTPDialogResources.py
index 399913c..631b7af 100644
--- a/wizards/com/sun/star/wizards/web/FTPDialogResources.py
+++ b/wizards/com/sun/star/wizards/web/FTPDialogResources.py
@@ -21,7 +21,7 @@ class FTPDialogResources(object):
     RID_COMMON_START = 500
 
     def __init__(self, oWizardResource):
-        super(FTPDialogResources, self).__init__(xmsf, self.MODULE_NAME)
+        super(FTPDialogResources, self).__init__()
 
         self.resFTPDialog_title = oWizardResource.getResText(
             self.RID_FTPDIALOG_START + 0)

since FTPDialogResources.py inherits from "object" not from "WizardDialog"

2) Then I had:
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_General.py", line 88, in getFTPDialog
    self.ftpDialog = FTPDialog(self.xMSF, pub, self.oWizardResource)
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialog.py", line 116, in __init__
    self.setDialogProperties( True, 160, HelpIds.getHelpIdString(HID_FTP),
AttributeError: 'FTPDialog' object has no attribute 'setDialogProperties'
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_Events.py", line 447, in showFTPDialog
    return self.getFTPDialog(pub).execute(self) == 1
AttributeError: 'NoneType' object has no attribute 'execute'

so disabled "self.setDialogProperties" line for the test.

3) Then I had:
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_General.py", line 88, in getFTPDialog
    self.ftpDialog = FTPDialog(self.xMSF, pub, self.oWizardResource)
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialog.py", line 120, in __init__
    self.build()
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialog.py", line 177, in build
    (14, HelpIds.getHelpIdString(HID_FTP_OK), self.resources.resbtnOK_value, "btnOK", 165, 142, PushButtonType_OK_value, 13, 50), self)
NameError: global name 'PushButtonType_OK_value' is not defined
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_Events.py", line 447, in showFTPDialog
    return self.getFTPDialog(pub).execute(self) == 1
AttributeError: 'NoneType' object has no attribute 'execute'

So I tried:
from com.sun.star.awt.PushButtonType import OK, CANCEL, HELP, STANDARD

but finally I had this:
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/ui/UnoDialog.py", line 134, in insertControlModel
    (sPropNames, oPropValues))
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/uno.py", line 256, in invoke
    return pyuno.invoke( object, methodname, argTuple )
uno.com.sun.star.lang.IllegalArgumentException: Unable to convert the given value for the property PushButtonType.
Expected type: short
Found type: com.sun.star.awt.PushButtonType
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/ui/UnoDialog.py", line 134, in insertControlModel
    (sPropNames, oPropValues))
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/uno.py", line 256, in invoke
    return pyuno.invoke( object, methodname, argTuple )
uno.com.sun.star.lang.IllegalArgumentException: Unable to convert the given value for the property PushButtonType.
Expected type: short
Found type: com.sun.star.awt.PushButtonType
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/ui/UnoDialog.py", line 134, in insertControlModel
    (sPropNames, oPropValues))
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/uno.py", line 256, in invoke
    return pyuno.invoke( object, methodname, argTuple )
uno.com.sun.star.lang.IllegalArgumentException: Unable to convert the given value for the property PushButtonType.
Expected type: short
Found type: com.sun.star.awt.PushButtonType
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_General.py", line 88, in getFTPDialog
    self.ftpDialog = FTPDialog(self.xMSF, pub, self.oWizardResource)
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialog.py", line 121, in __init__
    self.disconnect()
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/FTPDialog.py", line 347, in disconnect
    self.setEnabled(self.btnOK, False)
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/ui/UnoDialog.py", line 266, in setEnabled
    control.Model.Enabled = enabled
AttributeError: 'NoneType' object has no attribute 'Model'
Traceback (most recent call last):
  File "/home/julien/compile-libreoffice/libreoffice/instdir/program/wizards/web/WWD_Events.py", line 447, in showFTPDialog
    return self.getFTPDialog(pub).execute(self) == 1
AttributeError: 'NoneType' object has no attribute 'execute'


So it seems we've got something quite broken here.

May one of you take a look or at least give some hint?
Thank you in advance.
Comment 3 Javier Fernández 2015-07-06 20:36:56 UTC
(In reply to Julien Nabet from comment #2)
> Xisco/Javier: 

> So it seems we've got something quite broken here.
> 
> May one of you take a look or at least give some hint?
> Thank you in advance.

I can barely remember the code, actually, but I'd try to get it back and take a look, at least, to give some hint.
Comment 4 Julien Nabet 2015-09-23 22:04:20 UTC
Created attachment 118979 [details]
dirty patch

Here's a dirty patch (magic values and other bad things...) but would like to know if I'm on the good way when I inherit FTPDialog from WizardDialog instead of UnoDialog2, UIConsts.

Anyway, with this, FTP dialog opens at last.

Javier/Xisco: Any thoughts?
Comment 5 Javier Fernández 2015-09-24 07:58:58 UTC
(In reply to Julien Nabet from comment #4)
> Created attachment 118979 [details]
> dirty patch
> 
> Here's a dirty patch (magic values and other bad things...) but would like
> to know if I'm on the good way when I inherit FTPDialog from WizardDialog
> instead of UnoDialog2, UIConsts.
> 
> Anyway, with this, FTP dialog opens at last.
> 
> Javier/Xisco: Any thoughts?

I'm not really sure. I just ported the java code to python. I remember it worked properly at that time, so perhaps something changed in the python Uno bindings. There are other dialogs/windows inheriting from  UnoDialog2, like StatusDialog; are they broken as well ? 

It's true that fax, letter, ... inherit from WizardDialog, so there is no point, I guess, on keeping the Web dialogs different. Hence, I think your approach is correct.
Comment 6 Julien Nabet 2015-09-24 08:17:35 UTC
Thank you for your feedback Javier.
Except a typo I fixed on 2015, UnoDialog2.py hasn't changed since the end of 2012.
So indeed since it's a dialog and the other dialogs inherit from WizardDialog, let's inherit of it too.

The next thing is to understand how to use HIDMAIN to replace random value "46000" (where to declare it, which value, etc...perhaps a new file "FTPDialogConst.py" ?)
Then how to replace properly PushButtonType_OK_value, cancel and help.
I'll try to investigate (I think I could find soluce for PushButtonType in git history of other dialogs).
However, if you have already hints in mind, I'd be very interested of course! :-)
Comment 7 Xisco Faulí 2015-09-24 08:45:15 UTC
Hi Julien,

Regarding the HIDMAIN values in fax and letter wizards, they're 41180 and 40820 respectively, which are used as an array position in wizards/common/HelpIds.py. 
Taking a look at that file, I see that WIZARDS_HID0_WEBWIZARD has HID:34200. What happens if you use 34200 instead of 46000?
Comment 8 Julien Nabet 2015-09-24 08:56:34 UTC
Thank you Xisco for your feedback, I'll give it a try.
Comment 9 Julien Nabet 2015-09-24 22:09:37 UTC
I submitted a patch to gerrit:
https://gerrit.libreoffice.org/18831

It's far from perfect but at least, FTP dialog opens and I tried to use existing constants.
As I indicated in the comment of the patch, there are still bugs to fix to make FTP useable.
Comment 10 Julien Nabet 2015-09-24 22:11:18 UTC
Xisco: I tried 34200 value and it was ok. Then I noticed HID_FTP (value=41040), I thought it could be more appropriate.
Comment 11 Commit Notification 2015-10-01 09:36:08 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7e09b3656472bd5a3ef4090fd2ea6f521956fd53

tdf#92553: Web Wizard: Not open FTP Configure on Web Wizard Preview Setting

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2015-10-01 14:08:52 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=05f24922fbf39c00b6d06f8594f0cd9b06b40b2c&h=libreoffice-5-0

tdf#92553: Web Wizard: Not open FTP Configure on Web Wizard Preview Setting

It will be available in 5.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Julien Nabet 2015-10-01 14:10:59 UTC
At least, FTP dialog opens now.