SID-02310: Rename application doesn't update referring links
| Status: |
Answered |
TWiki version: |
6.0.2 |
Perl version: |
|
| Category: |
CategoryApplications |
Server OS: |
|
Last update: |
9 years ago |
I'm trying to write a simple "rename topic" application (one page; HTML form calling TWiki
rename script).
It works for the rename but does not update referring links. As the use case for this app is to rename
Parent Topics (which this client is calling "folders"), updating links is critical.
I am including the
...
<form name="new" action="%SCRIPTURLPATH{rename}%/%BASEWEB%/%FolderTopic%" method="post" onsubmit="if( this.newtopic.value=='' ) { alert( 'No name entered.' );return false; }; return true;">
| *Folder* | *Change Name to* |
| <select name="topic" class="twikiSelect">%SEARCH{
".*Folder$"
web="%BASEWEB%"
scope="topic" type="regex" nonoise="on"
sort="topic"
format="<option value='$topic'>$topic</option>"
separator=" "
}%</select> | <input type="text" name="newtopic" value="" size="30" class="twikiInputField" style="width: 94%" placeholder="New Name of Folder" /> |
%METASEARCH{type="parent" web="%BASEWEB%" topic="%FolderTopic%" format="<input value=\"$web.$topic\" checked=\"checked\" name=\"referring_topics\" class=\"twikiCheckBox\" type=\"checkbox\" />$topictitle <br>" }%
<input type="hidden" name="topic" value="%FolderTopic%" />
<input type="hidden" name="newweb" value="%BASEWEB%" />
<input type="hidden" name="currentwebonly" value="off" />
<input type="hidden" name="confirm" value="on" />
<input type="submit" name="Rename folder" value="Rename folder" class="twikiSubmit" />
</form>
Reference topics:
Sandbox.BagelryFolder,
Sandbox.PizzeriaFolder,
If you try out the LIVE form below, please rename anything you test back to its original name!!!
--
Vicki Brown - 2017-03-30
Discussion and Answer
Is it really as simple as including one more form field?
<input type="hidden" name="topic" value="%FolderTopic%" />
Apparently so.
--
Vicki Brown - 2017-04-02
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.