Skip to content

Commit

Permalink
Fix an issue that new figures cannot be edited
Browse files Browse the repository at this point in the history
  • Loading branch information
msakuta committed May 19, 2024
1 parent e54f922 commit 3a765b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function editForm(Doku_Event $event, $param){
// Pass wikitext through POSTs for previewing and saving
if(isset($_POST['editfigure__new'])) {
foreach($_POST['editfigure__new'] as $k => $v) {
$form->addHidden("editfigure__new[$k]", $v);
$form->setHiddenField("editfigure__new[$k]", $v);
}
}
}
Expand All @@ -152,7 +152,7 @@ public function editFormNew(Doku_Event $event, $param){
// Pass wikitext through POSTs for previewing and saving
if(isset($_POST['editfigure__new'])) {
foreach($_POST['editfigure__new'] as $k => $v) {
$form->addHidden("editfigure__new[$k]", $v);
$form->setHiddenField("editfigure__new[$k]", $v);
}
}
}
Expand Down Expand Up @@ -230,6 +230,7 @@ function handle_newfigure($event) {
// return to edit page
$INPUT->post->set('target', 'section');
$TEXT = $fields['pre']."<skcanvas>\n".$TEXT."</skcanvas>".$fields['suf'];
$INPUT->post->set('wikitext', $TEXT);
$ACT = 'edit';
break;
}
Expand Down

0 comments on commit 3a765b3

Please sign in to comment.