Page MenuHomePhabricator

preg_replace error in page forms when previewing or saving a page's template call from form
Open, Needs TriagePublic

Description

I have a form that reads the current template call of a page and populates itself. When I change something and click "preview" or "show changes" I get:
"Warning: preg_replace(): Compilation failed: nothing to repeat at offset 0 in /home/ccmdb/ccmdb.kuality.ca/extensions/PageForms/includes/PF_FormPrinter.php on line 1457"

Also, the show changes (or save) end up an empty page.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 21 2016, 11:21 PM

Could you paste the form definition here?

Here is the form definition:

<noinclude>
This is the 'Data Element' partial form.
{{#forminput:form=Data element}}


</noinclude><includeonly>

{{{info|partial form|edit title=Add or change data element information|create title=create some data element documentation}}}

{{{for template|Data element|label=edit the data element information|multiple}}}
'''Field name:''' 
{{{field|field_name}}}

{{{end template}}}

{{{standard input|summary}}}

{{{standard input|minor edit}}} {{{standard input|watch}}}

{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}}
</includeonly>

The error happens if I press "show preview"

Template Data Element is as follows. I initially had all the fields of it in the form but took all but one out as part of troubleshooting:

{| class="wikitable" border="1" style="float:right; width:30%"
|-
| style="background:silver; color:arsenic" align="right"| '''Field Name: '''
|[[FieldName::{{{field_name|not stated}}}]]
|-
| style="background:silver; color:arsenic" align="right"| '''Table: '''
|[[{{{in_table|not stated}}}]][[InTable::{{{in_table|not stated}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''Data type: '''
|{{{data_type|not stated}}}[[fieldDataType::{{{data_type|not stated}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''Length: '''
|{{{datafield_length|not stated}}}[[fieldLength::{{{datafield_length|not entered}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''Program: '''
|{{{program_collecting|Med and CC}}}[[DataElementProgram::{{{program_collecting|Med and CC}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''Created/Raw: '''
|{{{created_raw|not entered}}}[[FieldCreatedRaw::{{{created_raw|not entered}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''Start Date: '''
|{{{data_element_start_date|1900-01-01}}}[[DataElementStartDate::{{{data_element_start_date|1900-01-01}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''End Date: '''
|{{{data_element_end_date|2300-01-01}}}[[DataElementEndDate::{{{data_element_end_date|2100-01-01}}}| ]]
|-
| style="background:silver; color:arsenic" align="right"| '''Sort Index: '''
|{{{data_element_sort_index|999}}}[[DataElementSortIndex::{{{data_element_sort_index|999}}}| ]]
|}
{{{element_description}}} [[elementDescription::{{{element_description}}}| ]]
<includeonly>[[Category: Data structure]][[Category:{{{in_table}}}]]</includeonly>
<noinclude> 
To use:
 {<nowiki>{</nowiki>Data_element
 | field_name = 
 | element_description = 
 | in_table = (L_Log table / 
 | data_type =
 | datafield_length = 
 | program_collecting = (CC / Med / Med and CC)
 | created_raw = (created / raw)
 | data_element_start_date = (date)
 | data_element_end_date = (date)
 | data_element_sort_index = (row number in table)
 <nowiki>}</nowiki>}
</noinclude>

The FieldName Property is defined as

This is a property of type [[Has type::String]].