Page MenuHomePhabricator

Page Forms extension: Creating a form does not show drop down boxes after editing.
Closed, InvalidPublic

Description

  1. I just installed Page Forms and used the special page to create a form and a template.
  2. I used the special page FormEdit to create a new page using that form. Two properties did show drop down boxes as these properties have "allowed values". I did not complete that process as these two properties did not contain the correct enumeration values nor were their names correct.
  3. After that I renamed these two properties and edited them to correct the allowed values.
  4. I corrected the template and the form to use the new property names.
  5. I reloaded the special page FormEdit to now create a page as intended originally, but now the drop down boxes for these properties edited are gone. This is a bug. The special page should provide a drop down box here.

Update: The form editing code in the extension seems to fall back to data type Page though Text is specified. If I display data via the template a link is presented that clearly indicates that data type Page is assumed for these properties though they are Text in reality.

BTW: Latest version of SMW installed via composer, latest version of Page Forms installed from GitHub as recommended.

Event Timeline

That 2nd part, in the "Update", doesn't sound like a forms issue - you're seeing a problem in a page that calls a template, with no form involved. It sounds like there's an error in the property name(s) in the template. My guess is that that's what is causing the form problems as well - because there's an error in the template, the form can't figure out what values to use for the dropdown inputs.

You were indeed right! I did not see that I have to apply changes at two positions on the Wiki page defining the form - actually not the form, but the *template*. My sincere apologies!

Please note that this is confusing.

I have two pages:

  • A form Wiki page.
  • A template Wiki page.

The form to enter data displayed by Special:FormEdit/HWComponentMemoryForm/.... contains the definitions but Special:FormEdit apparently looks at the template in order to learn which properties to use and which type they are. I understand the necessities, but I intuitively always assumed the form definition is for presenting the form to the user, and the template is intended for presenting a non-edit view of the data. That at least would seem to be natural somehow - which seems not to be the case here. Having the form rendering logic looking into the template is ... confusing. I would never have expected such a design. And I always named the identifiers used by the form identical to the properties so I never thought about this so thoroughly. That's why I was not able to detect this error myself in the first place.

Of course it's too late to change the software design now. It would break compatibility with a lot of Wikis now. I understand that. But maybe you want to leave a hint in the documentation of the extension for other people to understand the mechanics here as well.

You can safely close the issue. Thank you for your help!

Yaron_Koren claimed this task.

Great! By the way, you can specify the property for a form field directly by adding the "property=" parameter to the field's tag in the form definition.

Yaron_Koren changed the task status from Resolved to Invalid.Nov 19 2018, 3:55 AM

"Invalid" is probably the right status.