Page MenuHomePhabricator

Using the one-step form linking process when generating dynamic forms fails with error message sf_autoedit_notargetspecified
Open, LowPublic

Description

Hi

I generate forms dynamically on runtime with a lua module. Essentially my form page looks like this

<noinclude>{{#invoke:ModuleName|sfGenerateFormEntry}}</noinclude>
<includeonly>{{#invoke:ModuleName|sfGenerateForm}}</includeonly>

This works in all regards, except when I try to use the one step process for form creation (ref: https://www.mediawiki.org/wiki/Extension:Semantic_Forms/Linking_to_forms#The_one-step_process). All I get is "No target page specified."

I traced the problem back to the function doAction() in the file SF_AutoeditAPI.php. [0]

Do you see a way how I could patch this?

[0]: doAction() gets the form content, but only the raw text (to avoid recursion?) with

// get the form content
$formContent = StringUtils::delimiterReplace(
  '<noinclude>', // start delimiter
  '</noinclude>', // end delimiter
  '', // replace by
  WikiPage::factory( $formTitle )->getRawText() // subject
);

Thus ascertaining the {{{info}}} tag via regex fails in my case ($formContent being something like {{#invoke:ModuleName|sfGenerateForm}}).

PS: class Wikipage:getRawText() is deprecated since 1.21 (ref: https://doc.wikimedia.org/mediawiki-core/master/php/classWikiPage.html#ac5797b098e1e19f6ae84755455424c35)

Event Timeline

Oetterer raised the priority of this task from to Low.
Oetterer updated the task description. (Show Details)
Oetterer subscribed.

Very interesting! I didn't think that that could be done. I'm adding Foxtrott, since he wrote that particular code in SF_AutoeditAPI.php.