Skip to content

Resolve Form handling in themes #1084

@Bloke

Description

@Bloke

Using <txp:output_form> in an error_* page/form doesn't render the form because it doesn't know which theme is in use. Under error conditions (e.g. wrong URL) there is no concept of a 'section' - the mechanism by which the theme pages and styles are determined.

Under normal conditions, the fetch_form() function tries to use the current URL theme (if it's known) but has no further logic than that. It will fail unceremoniously if it can't resolve the theme.

Possible revised workflow:

  1. Look up the 'power user logged in' theme first and use that if it's in use, as an override to...
  2. ... using the theme as determined by the URL section ($pretext) as it does now.
  3. Failing that, if the form name is unique (i.e. only in use by one theme, not default or some name that features in more than one theme) then use that. Safe enough to do so.
  4. Add a theme attribute to the tag, which overrides all the above and permits forms from other themes to be used at any time.

See here for background.

Does all of that sound reasonable? Any pitfalls? Better ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions