Page MenuHomePhabricator

SemanticForms: fragile syntax for auto-generated page names.
Closed, ResolvedPublic

Description

Author: van.de.bugger

Description:

{{{ info ... }}}

Note a space between {{{' and info'. It works in many cases. But in case of auto-generated form names:

{{{ info ... | page name=Visit:<unique number;start=1>}}}

the space before info' causes error. The problem is in specials/SF_FormEdit.php', in `printForm' function:

if ( $target_name === '' ) {

// parse the form to see if it has a 'page name' value set
$matches;
if ( preg_match( '/{{{info.*page name\s*=\s*(.*)}}}/m', $form_definition, $matches ) ) {

Obviously this will not match if there is a space between {{{' and info'.

Handling spaces should be consistent. SF should either allow spaces (include newlines) or disallows it.

The bug is not to serious, because there are simple workaround for it -- just write `{{{info' with no spaces. But, for novice users, it will be very frustrating and disappointing. It will looks like auto-generated page names are simply broken.

(BTW, this issue in NOT related to bug 32485; last one is still a problem even if there is no space).


Version: unspecified
Severity: normal

Details

Reference
bz32533

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:02 AM
bzimport set Reference to bz32533.

Well, it only took 2+ years, but I finally checked in a fix for this problem, based on your suggestion. Thanks, and sorry for the long delay!