News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom Form Mod

Started by live627, July 09, 2008, 10:24:44 PM

Previous topic - Next topic

Shades.

#2020
Tried to create a new field on a form for the first time in a while lol but it gave me this error. My form still works as it was but can't add new fields to it or to any other new forms.

QuoteField 'type_vars' doesn't have a default value
File: /home/*****/public_html/*****/Sources/ManageCustomForm.php
Line: 141

QuoteError
Type of error
Database
Error message
Database Error: Field 'type_vars' doesn't have a default value
File
/home/*****/public_html/*****/Sources/ManageCustomForm.php
Line
141
URL of page causing the error
https://*****.com/?action=admin;area=modsettings;sa=customform;form_id=1;add_field;

Backtrace information
#0: smf_db_error()
Called from /home/*****/public_html/*****/Sources/Subs-Db-mysql.php on line 494
#1: smf_db_query()
Called from /home/*****/public_html/*****/Sources/Subs-Db-mysql.php on line 802
#2: smf_db_insert()
Called from /home/*****/public_html/*****/Sources/ManageCustomForm.php on line 141
#3: ModifyCustomFormSettings()
Called from /home/*****/public_html/*****/Sources/Subs.php on line 6064
#4: call_helper()
Called from /home/*****/public_html/*****/Sources/ManageSettings.php on line 145
#5: ModifyModSettings()
Called from /home/*****/public_html/*****/Sources/Admin.php on line 510
#6: AdminMain()
Called from /home/*****/public_html/*****/index.php on line 190

Edit: I was able to correct it in the database by changing Field 'type_vars' to NULL. ;)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

nishuFun

on a very freshly installed 2.1.1

on creating "add new form" got this php error:
QuoteFatal error: Uncaught AssertionError: assert(isset($editorOptions['value'])) in C:\xampp\htdocs\smf\Sources\Subs-Editor.php:1514 Stack trace: #0 C:\xampp\htdocs\smf\Sources\Subs-Editor.php(1514): assert(false, 'assert(isset($e...') #1 C:\xampp\htdocs\smf\Sources\ManageCustomForm.php(170): create_control_richedit(Array) #2 C:\xampp\htdocs\smf\Sources\Subs.php(6001): ModifyCustomFormSettings() #3 C:\xampp\htdocs\smf\Sources\ManageSettings.php(142): call_helper('ModifyCustomFor...') #4 C:\xampp\htdocs\smf\Sources\Admin.php(499): ModifyModSettings() #5 C:\xampp\htdocs\smf\index.php(187): AdminMain() #6 {main} thrown in C:\xampp\htdocs\smf\Sources\Subs-Editor.php on line 1514

and on refreshing mod settings:

QuoteTitle    Board    Permissions    Modify
   0 ("Invalid Board")    Admin    
(Edit)    (Delete
smf 2.1.2

Senkusha

I just noticed a bug.  When viewing my Who's online list.  Everybody is:

QuoteNothing, or nothing you can see...

I had to remove the mod.
--Senkusha ("Kokoro")
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.2, PHP v. 8.0)

live627

 I have released v2.2.4 which fixes the issue in the Who's Online page

Shades.

SMF 2.1.2
Custom Form Mod 2.2.4

I've been noticing this for a while now but been reluctant to say anything about it because I thought I was going crazy :o  but my permissions for this mod only are being reset somehow on a daily basis to "Admin" and I have to go in and change them back to "Admin, Users, Global Moderator, Forum Leader, Assistant Admin".

No errors in logs! Any ideas what's causing this? ???

ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

live627

I have no idea. The permissions piggyback off off the standard SMF permissions system and are stored in smf_permissions with names such as custom_forms_{FORM_ID}

Shades.

Quote from: live627 on June 09, 2022, 10:14:11 PMI have no idea. The permissions piggyback off off the standard SMF permissions system and are stored in smf_permissions with names such as custom_forms_{FORM_ID}
Would you be interested in looking into my system if I gave you access via PM?
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Avid Gamer

Hi, I have recently upgraded to 2.0.18 to 2.0.19 (large upgrade) I was using v2.0.3 Custom forms and downloaded the 2.2.4, I am running PHP 7.4. I was getting error "Call to undefined function sortBoards()" when I tried to edit or create a new form (currently have 3) so I uninstalled and downloaded 2.2.3 from the github and got same message, I get no errors when using the 2.0.3 and ideas?

Great mod BTW.
Mess with the Best
Die like the Rest.

live627

Yeah, that's a function introduced in SMF 2.1. Gotta remove that call on line 328 in ManageCustomForm.php

sortBoards($boards);
replace with


// sortBoards($boards);

Avid Gamer

Quote from: live627 on July 04, 2022, 07:03:01 PMYeah, that's a function introduced in SMF 2.1. Gotta remove that call on line 328 in ManageCustomForm.php

        sortBoards($boards);
replace with


        // sortBoards($boards);

Thank you, love the mod.
Mess with the Best
Die like the Rest.

kwaka

I've been struggling with this mod for a few days now.
The form submits and displays fine but, as soon as a New Field is added, no go.

Using the Radio buttons causes an endless loop on Submit where the error states there are required fields when the isn't any required fields.

Using the Select box, the New Fields are there and works on Submit but the New Fields do not appear on the submitted form.

Yes I've completely uninstalled/deleted/removed the mod and reinstalled. Issue remains.

Tried as per above post, placing // in the code sortBoards($boards); in ManageCustomForm.php this has not fixed anything.

Any tips on how to fix/make the added New Fields display correctly?
Thanks.


kwaka

Please disregard my previous post. All fixed, form/s working as expected now.
Main issue was that I'd forgot about the lower case and other requirements in the Form Fields.

Sorry to trouble you, terrific mod, carry on.  8)

Shades.

How can I make the "Large Text" box default bigger to match the length of the other boxes? (see attachment)

You cannot view this attachment.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

live627

https://github.com/live627/smf-custom-forms/blob/dbf39089dbbe06203cd57361461275d8af29d118/src/Class-CustomForm.php#L282

In ./Sources/Class-CustomForm.php, find

'<textarea name="%s[%d]" %s%s>%s</textarea>',
Replace with


'<textarea name="%s[%d]" style="width: 90%%;" %s%s>%s</textarea>',

Shades.

ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

kwaka

#2035
G'day all,

I keep having this "required" Extra Type Parameters issue with both the Radio and Check Box options in a form.

New install of SMF as per:
SMF version: SMF ver. 2.1.2
Default Forum Language: English British en_UK
Theme name and version: SMF Default Theme - Curve2
Mods installed: Mods list 16 as per attached screenshot. Not all are installed though.

Whether using one or both Radio and Check Box and these are ticked/checked, after clicking the Submit Form button the Fields marked with an asterisk (*) are required keeps appearing, and yes in red text and yes too, the form is not submitted.

The Radio Buttons even if required is omitted in the Extra Type Parameters, will not submit and keeps asking for the required parameters. See attached.

Also, the Check Box does work without the required parameter, but with or without checking the box, the reply/answer is always no.

As the Radio and Check Box options have those issues, the current work around is using required in the Select Box, this works fine.

NOTE: The issue remains even if the Custom Form Mod is the only mod installed, nor does in matter which browser is used.

Nothing in the logs either.

Any ideas/suggestions on how to fix both these Radio and Check Box issues?

Thanks.

Radio Buttons
You cannot view this attachment.
You cannot view this attachment. 
You cannot view this attachment.
You cannot view this attachment.
You cannot view this attachment.

Mods
You cannot view this attachment.

Shades.

SMF 2.1.2
Custom Form Mod   2.2.4

Installed this on a new site and when editing or adding new form fields I get this error:

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined variable: board
File
/home/******/public_html/******/Sources/ManageCustomForm.php
Line
270
URL of page causing the error
https://******.com/?action=admin;area=modsettings;sa=customform;form_id=2;

Backtrace information
#0: smf_error_handler()
Called from /home/******/public_html/******/Sources/ManageCustomForm.php on line 270
#1: ModifyCustomFormSettings()
Called from /home/******/public_html/******/Sources/Subs.php on line 6118
#2: call_helper()
Called from /home/******/public_html/******/Sources/ManageSettings.php on line 144
#3: ModifyModSettings()
Called from /home/******/public_html/******/Sources/Admin.php on line 509
#4: AdminMain()
Called from /home/******/public_html/******/index.php on line 192
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

live627

Quote from: kwaka on October 06, 2022, 12:52:31 PMG'day all,

I keep having this "required" Extra Type Parameters issue with both the Radio and Check Box options in a form.

[...]

Any ideas/suggestions on how to fix both these Radio and Check Box issues?

Thanks
Thanks for the detailed bug report. I'm working on a new version of this mod that will fix those problems.

live627

The liberal overuse of help texts (the verbose text in the popups triggered by the question mark icons) somewhat annoys me. Most can either be removed or condensed into brief descriptions/subtexts that are on the setting pages.

live627

3.0.0 (2022-11-02)
⚠ BREAKING CHANGES
  • Drop support for SMF 2.0.x
Features
  • Add meta descriptions to forms for SERPs (7cc30b4)
  • Build linktree in forms (03ad761)
  • Form grid is now responsive (334ade3)
  • Make target board selection a list (4926bf6)
  • Request search engines to not index the thank you page (f55392f)
Bug Fixes
  • AssertionError (d76de71)
  • Checkbox validation didn't work at all (8aecc9e)
  • Radio button values needed to be set in HTML (5fc912d)
  • Undefined $board (877c242)

Advertisement: