This question about Missing functionality: Needs followup in Tasks
Can't create a topic with a name you can rename to (dash)
Using the "Create New Topic" function (WebCreateNewTopic) I can't create a topic with a dash ("-") in the name, but I can rename a topic to have a dash in the name.
Is this intended behavior? Can I override the restriction (for an entire web) in WebCreateNewTopic?
The
WebCreateNewTopic enforces valid topic names in javascript. The filename is
webtopiccreator.js
, and it enforces the following on the topic name:
Checks if the entered topic name is a valid WikiWord.
If so, enables the submit button, if not: enables the submit button if the user allows non-WikiWords as topic name; otherwise disables the submit button and returns 'false'.
Automatically removes spaces from entered name.
Automatically strips illegal characters.
If non-WikiWords are not allowed, capitalizes words (separated by space).
If non-WikiWords are allowed, capitalizes sentence.
The generated topic name is written to a 'feedback' field.
However I expect that the bug is really with the rename screen, which should enforce consistent rules for Topic Names. Punctuation can potentially cause issues, and will not be recognized as valid
WikiWords for auto-linking.
--
GeorgeClark - 02 Feb 2010
Just as a reminder, as stated in the comments, both of these screens have a checkbox that allows non-WikiWords in the topic name. I used hat in both cases.
I hope the dash character isn't considered an illegal character 'cuz I've got thousands of topics with names including dashes which are generated using the "save" script! I went looking for an authority on legal topic names and didn't find one, but that is probably due to my poor searching skills. My suggestion is that Foswiki shouldn't be too fussy, lacking some pretty substantial concern. For example, even though it would be a PITA, Foswiki could map user's characters into valid filename characters if file naming was a concern. Philosophically, it seems like users should be able to pick their own topic names without Foswiki butting in unless necessary.
I agree, however, that all of the ways topics can be named should have the same idea of what these names are allowed to be.
--
BigBaaadBob - 03 Feb 2010
We really need to separate topic name (an id which IMHO should be strict about valid chars) from a topic's title or label.
But we can't do this until we really integrate these two concepts in a better way
- Editor integration, to intelligently use a TopicTitle META as a first heading, and populate TopicTitle META from first heading if necessary
- Sync with topic ID should the ID (name) change (only feasible if TopicTitle = Topic name or
SPACEOUT{"TopicName"}
--
PaulHarvey - 03 Feb 2010
Unfortunately from what I can see, the javascript considers punctuation invalid in a topic name regardless of whether or not the wikiword validation is enabled. The WikiWord rules. Someone more knowledgeable in the internals would have to comment. The regular expressions internally for WikiWord linking only accept Upper, Lower and Digits. And it's a WikiWord only when it passes the Upper-Lower-Upper/digit pattern. That's what the checkbox controls, not punctuation.
Testing some topics named this way, they do appear to work, and are found in searches, etc. They do not auto-link, so links have to be forced using the [<nop>[ square bracket ]] notation.
The regular expressions that control WikiWords are defined in lib/Foswiki.pm but it would probably be quite risky to change them.
--
GeorgeClark
Still, isn't the fact that the two options (create topic and rename topic) do different things a bug? It seems to me that I should be able to create a topic with a name that I can rename an existing topic to. Right?
--
BigBaaadBob - 24 Feb 2010
yes, the javascript clearly has some bugs and inconsistencies on different pages. would you care to file a
Tasks.SMART bug report please? this should not be about allowing new characters in
WikiWords, but instead merely to allow them to be entered in the text box when appropriate. yes, non-WikiWord named topics require explicit [<nop>[ square bracket ]] notation, and many wiki apps do exactly this (ie, don't break this!
)
--
WillNorris - 25 Feb 2010
I would love to...except: my view is that the task should say "the 'create topic' function and the 'rename topic' function should allow the same set of characters in topic names, and the correct set of characters is the set accepted by the 'rename topic' function. Do you agree? This seems Specific and Measurable and Realistic and Actionable. Don't know about Timely though...
--
BigBaaadBob - 15 Mar 2010