Bug report #13506

Processing help files for QGIS algs all dead now

Added by Richard Duivenvoorde almost 4 years ago. Updated almost 4 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21550

Description

Hi Victor,

as a result of this thread:

https://lists.osgeo.org/pipermail/qgis-community-team/2015-October/004293.html

we removed all old/stale help files from the webserver.
(in short: some time ago we had one helpfile per algorithm, to speed up generation of the docs we create one html file per group of algorithms)

with that it turned out that the help tab of processing were actually poining to the old url's like:

http://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vector_analysis_tools/sumlinelengths.html#sum-line-lengths

whic are dead now.

These links should be:

http://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vector_analysis_tools.html#sum-line-lengths

note that the html should be in it.

If not clear, let me know.

Associated revisions

Revision ca697dba
Added by Jürgen Fischer almost 4 years ago

[processing] update algorithm help link (fixes #13506)

Revision 545a90de
Added by Victor Olaya almost 4 years ago

[processing] fixed scrolling to anchor in help pages

fixes #13506

History

#1 Updated by Paolo Cavallini almost 4 years ago

I see at least gdal and grass here, current master.

#2 Updated by Anita Graser almost 4 years ago

  • Subject changed from processing help files all dead now to Processing help files for QGIS algs all dead now

This change should only affect QGIS algs.

#3 Updated by Richard Duivenvoorde almost 4 years ago

I had a look into this, seems pretty easy to fix this line:

https://github.com/qgis/QGIS/blob/master/python/plugins/processing/core/GeoAlgorithm.py#L141

helpUrl = 'http://docs.qgis.org/{}/en/docs/user_manual/processing_algs/{}/{}/{}.html'.format(qgsVersion, providerName, safeGroupName, safeAlgName)

into

helpUrl = 'http://docs.qgis.org/{}/en/docs/user_manual/processing_algs/{}/{}.html#{}'.format(qgsVersion, providerName, safeGroupName, safeAlgName)

BUT: the safeAlgName is already 'cleaned', so there are no '-' in it anymore, while the anchors in the html file contain '-'

EG: using the line above, you will get the following url:

http://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vector_general_tools.html#orientedminimumboundingbox

while the anchor in current html files are like:

http://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vector_general_tools.html#oriented-minimum-bounding-box

so EITHER we have to have a look into the 'cleaning'-up of the url-components
OR we change the helpfiles to have anchors like #orientedminimumboundingbox

#4 Updated by Richard Duivenvoorde almost 4 years ago

Paolo Cavallini wrote:

I see at least gdal and grass hel here, current master.

Hi Paolo,

you say 'hel' you mean 'hell', like it is not working for you?

Because for me grass7 is (with or without my 'patch') still working ok.

GDAL is alway pointing to the same url (ogr2ogr).

I think there was a discussion already about where to point for help to for these external algorithm's isn't it?

#5 Updated by Paolo Cavallini almost 4 years ago

Typo, now corrected, sorry.

#6 Updated by Jürgen Fischer almost 4 years ago

  • Status changed from Open to Closed

#7 Updated by Anita Graser almost 4 years ago

  • Status changed from Closed to Reopened

Does this really work for you? For me, the help dialog loads the correct page but it doesn't jump to the correct heading.

Tested e.g. for Reproject layer, and Fixed distance buffer.

#8 Updated by Richard Duivenvoorde almost 4 years ago

Anita, I had seen that too, following is an email from me to alex and victor, (we are talking about
https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/AlgorithmDialogBase.py#L80 here)

Ok, it has something to do with the anchor loading in a non visible
webview tab.

If I add this
self.tabWidget.setCurrentIndex(2)·
above the line:
self.txtHelp.load(algHelp)

Then it just works....
But that means that the dialog always opens with the help, which is not
what we want off course...

So another hack would be to reload(!) the url when a user hits the help
tab. Tried that but that is ugly...

So third hack is to do 'lazy loading' of the help, that is only load the url
when the user hits the help tab.
Below some code which does that. Not sure if people are ok with that,
because that means it takes some seconds to fetch the help after going to the help...

But to me this would be ok

...
        # load algorithm help if available
        isText, algHelp = self.alg.help()
        if algHelp is not None:
            algHelp = algHelp if isText else QUrl(algHelp)
        else:
            algHelp = self.tr('<h2>Sorry, no help is available for this '
                              'algorithm.</h2>')
        try:
            if isText:
                self.txtHelp.setHtml(algHelp)
            else:
        # connect pressing tab to loadHelp func
                self.tabWidget.currentChanged.connect(self.loadHelp)
        # msg to user
                self.txtHelp.setHtml(self.tr('<h2>Getting help...</h2>'))
        # save QUrl for help
                self.algHelp = algHelp
        except:
            self.txtHelp.setHtml(
                self.tr('<h2>Could not open help file  </h2>'))

        self.showDebug = ProcessingConfig.getSetting(
            ProcessingConfig.SHOW_DEBUG_IN_DIALOG)

    def loadHelp(self, i):
    # only when the help tab is activated load the url
        if i == 2:
            self.txtHelp.load(self.algHelp)

#9 Updated by Victor Olaya almost 4 years ago

  • Status changed from Reopened to Closed

#10 Updated by Harrissou Santanna almost 4 years ago

  • Status changed from Closed to Reopened

The links in the processing algs help are NOT FOUND. Instead of http://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vector_analysis_tools.html#sum-line-lengths as stated in Richard's first message, you get the following message :
The requested URL /testing/en/docs/user_manual/processing_algs/qgis/vector_analysis_tools.html/sum-line-lengths.html was not found on this server.

Tested on master ea0ce4e

#11 Updated by Victor Olaya almost 4 years ago

  • Status changed from Reopened to Feedback

can you provide more detail?

I am not able to reproduce it here

Moreover, the code in the changeset that I added does not modify the URL of the help file or the way the page is loaded, it just adds the scrolling mechanism. It seems to me that the server for some reason was responding with that and changed the URL when displaying the message.

What do you get if you revert to a version before that changeset?

Thanks!

#12 Updated by Harrissou Santanna almost 4 years ago

Victor Olaya wrote:

can you provide more detail?

I am not able to reproduce it here

I just open any QGIS algorithm in the Processing toolbox and went to its Help tab. Nothing special.

Moreover, the code in the changeset that I added does not modify the URL of the help file or the way the page is loaded, it just adds the scrolling mechanism. It seems to me that the server for some reason was responding with that and changed the URL when displaying the message.

BTW, could the scrolling fix be backported to 2.8?

What do you get if you revert to a version before that changeset?

Thanks!

I've never succeeded building QGIS myself (on Win7 to 10) so I just use osgeo4w but I can't find how I can revert to a nightly build older than yesterday's. Any idea?

#13 Updated by Anita Graser almost 4 years ago

I can't reproduce the issue either (using OSGeo4W nightly). Are you sure you have the latest Processing version? Check the plugin manager. For me it says:

Installed version: 2.10.99 (in C:\\OSGEO4~1\\apps\\qgis-dev\\.\\python\\plugins\\processing)
Available version: 2.10.2 (in Offizielles QGIS-Erweiterungsrepositorium)

#14 Updated by Harrissou Santanna almost 4 years ago

  • Status changed from Feedback to Closed

Indeed, Anita, I didn't have the same version. As stated in your quote, the available one is 2.10.2 and this is the one I had installed.
I also remark that your installed version is in C:\\OSGEO folder while mine is still in \\users\\me\\.qgis2. So I removed the one in this folder and now each qgis app ships its own processing plugin.
All is ok now (the anchor and the help link).

#15 Updated by Harrissou Santanna almost 4 years ago

The Processing version i had in LTR was 2.6 (if I'm not wrong) so I update it to 2.10.2. New version was saved in \\.qgis2 folder, meaning that reopening qgis master (or any other release) fetches the processing version in \\.qgis2 and not the one in \\osgeo\\app folder.
I suppose I just have to copy/paste the 2.10.2 folder in ltr and delete it from \\.qgis2 and all will be ok but I'm wondering if there's not an issue with Processing updating.

Since it's a core plugin, shipped in app folder, shouldn't updating be made over the shipped version instead of creating a new folder in \\.qgis2?
Am I missing something or should I open a ticket for this (if there isn't)?

#16 Updated by Richard Duivenvoorde almost 4 years ago

@Harrissou fyi: processing is a core plugin, so when you install a version of QGIS the plugin is included in the QGIS-standard plugins folder. But when you update your plugins, and there is a newer version, the plugin is downloaded and put in your PERSONAL plugin folder.

If all is ok, the plugins in your peronsal folder should shadow the ones in the standard(installation) plugin folder, so you should not see/use the 'older' one.

IF there is still something wrong there (2.6 is old, and there have been issues with this in history), and you can give a clear way to describe, please create a new issue for this.

#17 Updated by Harrissou Santanna almost 4 years ago

Richard Duivenvoorde wrote:

@Harrissou fyi: processing is a core plugin, so when you install a version of QGIS the plugin is included in the QGIS-standard plugins folder. But when you update your plugins, and there is a newer version, the plugin is downloaded and put in your PERSONAL plugin folder.

If all is ok, the plugins in your peronsal folder should shadow the ones in the standard(installation) plugin folder, so you should not see/use the 'older' one.

This is what I understood, what I said and what I'm complaining about (it doesn't just shadow older's). see #13685

Also available in: Atom PDF