Skip Navigation

[Resolved] I get PHP-error when I make a CRED-form

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.24 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Author
Posts
#655245

Hi Support.

You've been helping me several times and I hope you can help me with this:

I've have made a new CRED-form and ít have this PHP-error on the frontend:

Warning: in_array() expects parameter 2 to be array, integer given in /var/www/regnskabdanmark.dk/public_html/wp-content/plugins/cred-frontend-editor/application/models/field/generic.php on line 94

Warning: in_array() expects parameter 2 to be array, integer given in /var/www/regnskabdanmark.dk/public_html/wp-content/plugins/cred-frontend-editor/application/models/field/generic.php on line 94

Warning: in_array() expects parameter 2 to be array, integer given in /var/www/regnskabdanmark.dk/public_html/wp-content/plugins/cred-frontend-editor/application/models/field/generic.php on line 94

These lines is above the form it self.

The page is a draw and is named: hidden link

This is from the content-field in "Edit CRED-form":

[credform class='cred-form cred-keep-original']

[cred_field field='form_messages' value='' class='alert alert-warning']

<div class="form-group">
[cred_field field='post_title' post='udstiller' value='' placeholder='Firmanavn' urlparam='' class='form-control' output='bootstrap']
</div>

<div class="form-group">
[cred_field field='post_title' post='udstiller' value='' placeholder='Adresse' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<div class="row">
<div class="col-md-6">
[cred_generic_field field='Postnr.' type='numeric' placeholder='Postnr.' urlparam='' class='form-control' output='bootstrap']
{
"required":1,
"validate_format":1,
"default":""
}
[/cred_generic_field]
</div>

<div class="col-md-6">
<div class="form-group">
[cred_field field='post_title' post='udstiller' value='' placeholder='By' urlparam='' class='form-control' output='bootstrap']
</div>
</div>
</div>

<div class="form-group">
[cred_generic_field field='CVR-nummer' type='numeric' placeholder='CVR-nummer' class='form-control' urlparam='' output='bootstrap']
{
"required":1,
"validate_format":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
[cred_field field='post_title' post='udstiller' value='' placeholder='Kontaktperson' urlparam='' class='form-control' output='bootstrap']
</div>

<div class="form-group">
[cred_generic_field field='Telefon' type='phone' placeholder='Telefonnummer' class='form-control' urlparam='' output='bootstrap']
{
"required":1,
"validate_format":1,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
[cred_generic_field field='Email' type='email' placeholder='Email' urlparam='' class='form-control' output='bootstrap']
{
"required":1,
"validate_format":1,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
[cred_generic_field field='Hjemmeside' type='url' placeholder='Hjemmesideadresse' urlparam='' class='form-control' output='bootstrap']
{
"required":1,
"validate_format":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
[cred_generic_field field='Standstørrelse' type='select' class='form-control' urlparam='']
{
"required":1,
"validate_format":0,
"default":["Standstørrelse"],
"options":[
{"value":"Standstørrelse","label":"Standstørrelse"},
{"value":"9 kvm. (3 x 3m.)","label":"9 kvm. (3 x 3m.)"},
{"value":"12 kvm. (4 x 3m.)","label":"12 kvm. (4 x 3m.)"},
{"value":"15 kvm. (5 x 3m.)","label":"15 kvm. (5 x 3m.)"},
{"value":"18 kvm. (6 x 3m.)","label":"18 kvm. (6 x 3m.)"},
{"value":"21 kvm. (7 x 3m.)","label":"21 kvm. (7 x 3m.)"},
{"value":"24 kvm. (8 x 3m.)","label":"24 kvm. (8 x 3m.)"},
{"value":"27 kvm. (9 x 3m.)","label":"27 kvm. (9 x 3m.)"},
{"value":"30 kvm (10 x 3m.)","label":"30 kvm (10 x 3m.)"},
{"value":">30 kvm. (skriv ønsker i feltet \"Specielle ønsker i øvrigt\")","label":">30 kvm. (skriv ønsker i feltet \"Specielle ønsker i øvrigt\")"}
]
}
[/cred_generic_field]
<p style="font-size:75%">Vi gør hvad vi kan for at imødekomme jeres ønsker til standstørrelser og dimensioner. Dette afgøres dog først i det øjeblik, hvor Brøndbyhallen og Messecenter Fredericia sammensætter de enkelte stande.</p>
</div>

<div class="form-group">
[cred_generic_field field='Antal_aabne_sider' type='select' class='form-control' urlparam='']
{
"required":0,
"validate_format":0,
"default":["Antal åbne sider (1-4)"],
"options":[
{"value":"Antal åbne sider (1-4)","label":"Antal åbne sider (1-4)"},
{"value":"1","label":"1"},
{"value":"2","label":"2"},
{"value":"3","label":"3"},
{"value":"4","label":"4"}
]
}
[/cred_generic_field]
<p style="font-size:75%">Vi gør hvad vi kan for at imødekomme jeres ønsker til standens sider. Dette afgøres dog først i det øjeblik, hvor Brøndbyhallen og Messecenter Fredericia sammensætter de enkelte stande.</p>
</div>

<div class="form-group">
[cred_generic_field field='Specielle_oensker_i_oevrigt' type='textarea' placeholder='Specielle ønsker i øvrigt' class='form-control' urlparam='']
{
"required":0,
"validate_format":0,
"default":"Specielle ønsker i øvrigt"
}
[/cred_generic_field]
</div>

<div class="form-group">
[cred_generic_field field='Vi_oensker_at_udstille_foelgende_produkter_ydelser' type='textarea' placeholder='Vi ønsker at udstille følgende produkter/ydelser' class='form-control' urlparam='']
{
"required":0,
"validate_format":0,
"default":"Vi ønsker at udstille følgende produkter/ydelser"
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Ekstra tilvalg</label>
[cred_generic_field field='Ekstra_tilvalg' type='checkboxes' class='form-control' urlparam='']
{
"required":0,
"validate_format":0,
"default":0,
"options":[
{"value":"Vi ønsker at købe plads på Speakers Corner","label":"Vi ønsker at købe plads på Speakers Corner"},
{"value":"Vi ønsker at købe plads i TV-boksen","label":"Vi ønsker at købe plads i TV-boksen"}
]
}
[/cred_generic_field]

</div>

<div class="form-group">
<label>Godkend standleje</label>
[cred_generic_field field='Godkend_standleje' type='checkboxes' class='form-control' urlparam='']
{
"required":1,
"validate_format":0,
"default":0,
"options":[
{"value":"Vi godkender betingelser for standleje","label":"Vi godkender betingelser for standleje"}
]
}
[/cred_generic_field]

<p>Ved at sætte kryds herover godkender udstiller betingelser for standleje. Læs betingelser her"</p>
</div>

[cred_field field='form_submit' value='Submit' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']

[/credform]

Any ideas what I'm doing wrong?

Kind regards.

Kristen

#655317

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I see that warning is coming from generic field but to ensure that from which generic field this error is caused - could you please try to delete your generic fields one by one and check which generic field is causing the issue.

Additionally:
Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

#658600

Hi Minesh.

Thank you for your quick reply. I have found out that when I remove the following code the errors dissapear:

<div class="form-group">
<label>Ekstra tilvalg</label>
[cred_generic_field field='Ekstra_tilvalg' type='checkboxes' class='form-control' urlparam='']
{
"required":0,
"validate_format":0,
"default":0,
"options":[
{"value":"Vi ønsker at købe plads på Speakers Corner","label":"Vi ønsker at købe plads på Speakers Corner"},
{"value":"Vi ønsker at købe plads i TV-boksen","label":"Vi ønsker at købe plads i TV-boksen"}
]
}
[/cred_generic_field]

</div>

<div class="form-group">
<label>Godkend standleje</label>
[cred_generic_field field='Godkend_standleje' type='checkboxes' class='form-control' urlparam='']
{
"required":1,
"validate_format":0,
"default":0,
"options":[
{"value":"Vi godkender betingelser for standleje","label":"Vi godkender betingelser for standleje"}
]
}
[/cred_generic_field]

<p>Ved at sætte kryds herover godkender udstiller betingelser for standleje. Læs betingelser her"</p>
</div>

What have I done wrong?

Kind regards

Kristen

#665935

Hi Minesh.
I tried to delete the code that made the problem and then reinstall the code.

Now it works!

Thank you for your time.

Kind regards

Kristen