LISE frontend form (FormBuilder) with default values fails

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
webform
Power Poster
Power Poster
Posts: 460
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

LISE frontend form (FormBuilder) with default values fails

Post by webform »

I have discovered an interesting problem, that if you set a default value for a FormBuilder form, which sends form results to LISE, you get a Database error.

Code: Select all

{FormBuilder form='capture_comment' value_fld83=$item->title value_fld82=$item->serial}
LISE Database error: 0 -  - Query: SELECT COUNT(alias) as alias FROM cms_module_lisecomments_item WHERE alias LIKE "000005%" LIMIT  1! @ /var/www/domain.com/public_html/app/lldb/modules/LISE/lib/class.LISEItemOperations.php (203)
If you predefine the values itself directly in FormBuilder, e.g. in a Hidden Field, then the form works and submit to LISE without error.

I am trying to create a comment module where logged in users can add comments to another LISE module.
The form is inserted in the Detail Template for the LISE module. And besides the form failing if there is a default value, the detail template "disappears" on submit, even if the form is set to inline without a default value.

So I guess I have to go back to the drawing board and find a new way to solve the problem of being able to comment on a LISE post.
webform
Power Poster
Power Poster
Posts: 460
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: LISE frontend form (FormBuilder) with default values fails

Post by webform »

I have kinda solved it with a bit of a hack:

In my LISE detail template i set my variables i need in my comment form:

Code: Select all

{$lesson_title="{$item->title}" scope=global}
{$lesson_id="{$item->serial}" scope=global}
Then in my form i use hidden fields to get the variables with "Process Smarty tags within field" set to active.
I also have a hidden field with {smx::self_url()} (SmartyExt module) to get the current URL for the LISE single detail page containing the form and the submission template containing

Code: Select all

{if $original_url != "" && $original_url != "[unspecified]" }{redirect_url to=$original_url}{/if}
to reload the LISE detail page with the newly added comment. Only downside is the lack of submission message, but the user can see the comment added to the page, so that's an acceptable trade off for now.

Oh, and i set the form to NOT be inline, so it's not failing when part of the LISE detail template.
Post Reply

Return to “Modules/Add-Ons”