Page MenuHomePhabricator

Error in form definition! After upgrading PageForms to v5.5.1
Open, Needs TriagePublic

Description

MW v 1.35.1
SMW v 3.2.2
PageForms v 5.5.1

I upgraded PageForms from 4.9.4 to 5.5.1. After the upgrade I have this issue when I try to use some forms (not all forms). (Error in form definition! The following field tag contains forbidden characters:
size=30</li></ul>
<p>)

error img: https://ibb.co/J3FGs2s

I am not using these character neither in the targeted form nor in the linked template but I do not know why this error occurs. Version 4.9.4 does not show the error and the form works fine but I cannot add classes or properties using this version as it has deprecated functions that needs a version upgrade

any solution for that please?

Event Timeline

If possible, could you paste here the form definition for the form where this error is occurring?

This comment was removed by Amerm2.
<noinclude>
This is the "PA1Ext" form.
To create a page with this form, enter the page name below;
if a page with that name already exists, you will be sent to a form to edit that page.


{{#forminput:form=PA1LAE}}

</noinclude><includeonly>
<div id="wikiPreview" style="display: none; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid #AAAAAA;"></div>
{{{for template|PA1LAE}}}
{| class="formtable"
{{ProtocolFormsCommonFields|subproject=Project A1|section2=Input Workpiece Characteristics|samplelabel=Created Sample}}
! Length (mm) 
| {{{field|HasInputLength|size=10}}}
|-
! Diameter (mm) 
| {{{field|HasInputDiameter|size=10}}}
|-
! Billet Temperature (°C) 
| {{{field|AppliedBilletTemperature|size=10}}}
|-
! <span>Output Workpiece Characteristics</span> 
|-
! Length (mm) 
| {{{field|HasOutputLength|size=10}}}
|-
! Diameter (mm) 
| {{{field|HasOutputDiameter|size=10}}}
|-
! Corresponds to profile section (mm)
| {{{field|correspondsToProfileSection|size=10}}}
|-
! Notes: 
| {{{field|Notes|input type=textarea|autogrow}}}
|}
{{{end template}}}

{{ProtocolTools|protocoltype={{#sub:{{PAGENAME}}|0|6}}}}

'''Free text:'''

{{{standard input|free text|rows=10}}}


{{{standard input|summary}}}

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

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

Okay, thank you. Where is "size=30" coming from? I'm guessing it's from the "ProtocolFormsCommonFields" template. If so, could you paste the contents of that template?

<noinclude>

'''Summary:''' Template creates common fields in Protocols Forms. See more in [[Help:Protocols]]
   

'''Invoke:''' within template 
<pre>
{| class="formtable"

{{ProtocolFormsCommonFields|subproject=Project C2|section2=Original Characteristics of Test Model|samplelabel=Applied on Sample}}

! Heat distribution: 
| {{{field|Heat distribution}}}
</pre>

<s>Or, in cases where ''Demonstrator'' and ''Material combination'' should not present or place in other location of the form.</s>
NOT IMPLEMENTED: 
<pre>
{{ProtocolFormsCommonFields|subproject=Project C2|section2=Original Characteristics of Test Model|hideDemoNmaterial=True|samplelabel=Applied on Sample}}
</pre>







'''Note:''' character inside the form fields such as <nowiki>{ | }</nowiki> has to be escaped with <nowiki><nowiki></nowiki> tags

'''Source:'''
<pre>
...
</pre>
</noinclude>


<includeonly>
! <span>General Protocol Information</span> 
|-
! Applied by Subproject: 
| <nowiki>{{{</nowiki>field<nowiki>|</nowiki>Applied by Subproject<nowiki>|</nowiki>default={{{subproject}}}<nowiki>}}}</nowiki>
|-
! Applied by Person: 
| <nowiki>{{{</nowiki>field<nowiki>|</nowiki>Applied by Person<nowiki>|</nowiki>input type=text<nowiki>}}}</nowiki>
|-
! {{{samplelabel}}}:
| <nowiki>{{{</nowiki>field<nowiki>|</nowiki>{{{samplelabel}}}<nowiki>|</nowiki>values from category=Samples<nowiki>|</nowiki>input type=tokens<nowiki>|</nowiki>existing values only<nowiki>}}}</nowiki>
|-
! Date: 
| <nowiki>{{{</nowiki>field<nowiki>|</nowiki>Date<nowiki>|</nowiki>property=Date<nowiki>|</nowiki>input type=datepicker<nowiki>|</nowiki>mandatory<nowiki>}}}</nowiki>
|-
! Linked Data Resources in [https://service.tib.eu/sfb1153/ckan/ CKAN]: 
| <nowiki>{{{</nowiki>field<nowiki>|</nowiki>DataResourceUrl<nowiki>|</nowiki>input type=tokens<nowiki>}}}</nowiki>
|-
! <span>{{{section2}}}</span> 
|-
</includeonly>

I think it comes from Protocol Tools templates as it contains some metadata such as

* '''Heating type''': <nowiki>{{{</nowiki>field<nowiki>|</nowiki>rollingApparatus_HeatingType<nowiki>|</nowiki>size=30<nowiki>}}}

entire template is here https://files.fm/u/sb5kv8czu

Wow, okay. The fact that the error has to do specifically with some line with "size=30" makes me think that this is a specific problem on one line, and that your approach in general still basically works. If you don't mind doing it, one approach to identifying the problem is to change each of the lines with "size=30" (there seem to be seven of them) to a different size, like 31, 32, etc., to try to isolate the line that the code is complaining about.