Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greebo: new page / namespaces broken #2355

Closed
stueja opened this issue Apr 27, 2018 · 9 comments
Closed

Greebo: new page / namespaces broken #2355

stueja opened this issue Apr 27, 2018 · 9 comments
Assignees
Labels
Milestone

Comments

@stueja
Copy link

stueja commented Apr 27, 2018

When entering a new namespace/pagename in the search field (e. g. it:server:setup), the latest release converts that to server_setup with an underscore. (See also article of a different user in German forums on dokuwiki webpage).

@splitbrain splitbrain added the Bug label Apr 27, 2018
@splitbrain splitbrain added this to the 🐱 Greebo milestone Apr 27, 2018
@splitbrain
Copy link
Collaborator

@micgro42 I guess createPagenameFromQuery is a bit too clever or maybe not clever enough. My first instinct was to simply see if the query contains no spaces, if so just pass the query as is to cleanID. But we need to take the namespace into account (which may have be added automatically)... Any ideas how to solve this?

@stueja as a workaround you can use setup @it:server for now.

@micgro42
Copy link
Collaborator

micgro42 commented Apr 27, 2018

Passing the query to cleanID is basically what we did before Greebo and it messes things up if one uses anything different than the most basic query. E.g. if you searched for foo -bar you got the page foo_bar suggested which is very likely not what you want, since you explicitly excluded bar.

However, I can add a check to see whether cleanID() leaves the query unchanged, i.e. the query is already a valid pageid, and than return that query as the suggested page name. The parsed query would than only be used for cases where the query is not a valid pageid.

That being said, using the search as a primary means to create new pages is not the way it's supposed to be. Create links on other pages for that purpose. ☝️

@micgro42
Copy link
Collaborator

micgro42 commented Apr 27, 2018

Also using "it:server:setup" (with double quotes) works just fine...

@michitux
Copy link
Collaborator

@micgro42 the documentation explicitly mentions the search as a possibility to create pages (btw. that needs to be updated for the new release). I think for users that don't want to/don't know how to edit the URL and don't want to create a link (e.g. because they use a full sitemap as sidebar where the page will be linked automatically) this is the easiest/only way to create a page.

micgro42 added a commit that referenced this issue Apr 27, 2018
Specifically, this pull request checks if the current query is already a
valid pageid and then return that as suggested pageid.

Also, tests are added for this method.

Fixes #2355

PS: We may want to somehow better educate/nudge users to use the better
way of creating pages by creating links on existing pages.
@micgro42
Copy link
Collaborator

@michitux Thanks, your reference to the documentation does give that request a bit more reasonability. However, I consider this a negative side-effect of aggregating functionalities, that the basic links between pages are eroded. Nevertheless, the documentation should accurately reflect the intended state of the application. Which part do you consider out of date? (execpt the screencast by @splitbrain, which I cannot even play anymore.)

@michitux
Copy link
Collaborator

@micgro42 The documentation says that you can just press the "create this page" button of the template. However, with the new UI, the page id is no longer changed (so you stay on the old page) but there is an explicit link that you need to click in the text above the search result.

@micgro42
Copy link
Collaborator

micgro42 commented Apr 27, 2018

Ah yes! Fixing it...

Edit: Done.

@stueja
Copy link
Author

stueja commented Apr 28, 2018

Thank you very much for the lightning fast presentation of workarounds ("it:server:setup" in double quotes) and solution!

@tormec
Copy link
Contributor

tormec commented Mar 25, 2020

I think the search field still has some bugs.

Hereafter I try to create pages and namespaces using the search field following the examples reported at https://www.dokuwiki.org/namespaces#creating_namespaces.

Let's say the page foo:bar:start already exists and it's the current namespace.

  • expected page :foo:bar:pg
    type pg return :pg
    type .pg return :pg
    type .:pg return :pg

  • expected page :pg
    type :pg return :pg ok

  • expected page :foo:pg
    type ..pg return :pg
    type ..:pg return :pg
    type .:..:pg return :pg

  • expected page :wiki:pg
    type wiki:pg return :wiki:pg ok

  • expected page :ns1:ns2:pg
    type ns1:ns2:pg return :ns1:ns2:pg ok
    type :ns1:ns2:pg return :ns1_ns2_pg

  • expected page :foo:bar:ns1:ns2:pg
    type .ns1:ns2:pg return :ns1_ns2_pg
    type .:ns1:ns2:pg return :ns1_ns2_pg

  • expected page :foo:ns1:ns2:pg
    type ..ns1:ns2:pg return :ns1_ns2_pg
    type ..:ns1:ns2:pg return :ns1_ns2_pg

  • expected page :foo:bar:ns1:ns2:start
    type .ns1:ns2: return :ns1_ns2
    type .:ns1:ns2: return :ns1_ns2

tested with Release 2018-04-22b "Greebo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants