Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hello,
this is the first time experimenting with DataBound Forms and I'm having a few issues.

First off, this is the kfunctions.php:
Code: Select all
<?php
if ( !defined('K_COUCH_DIR') ) die(); // cannot be loaded directly

//require_once( K_COUCH_DIR.'addons/cart/session.php' );
//require_once( K_COUCH_DIR.'addons/cart/cart.php' ); // automatically includes session
require_once( K_COUCH_DIR.'addons/data-bound-form/data-bound-form.php' );
//require_once( K_COUCH_DIR.'addons/inline/inline.php' );


I followed the guide and copied the important parts to make it easier on my part, but I'm getting errors:

First Issue:
ERROR: Tag "editable" has unknown type "securefile"

The code for that is this:
Code: Select all
    <cms:editable name='resume' required='1' allowed_ext='pdf, doc, docx' max_size='1024' type='securefile' />
[...]
        <label>Attach a Copy of Your Resume
            <cms:input name="resume" type="bound" />
            <p>Word or PDF Documents Only</p>
        </label>


These are basically copies of the tutorial since I'm still playing around with it.
I commented both out and the page render fine, without the file upload ofc.

Second Issue:
After submitting the form I get yet another Error:

ERROR! Unknown tag: "db_persist_form"

And the Code, again pretty much a copy of yours:
Code: Select all
    <cms:form
        masterpage=k_template_name
        mode='create'
        enctype='multipart/form-data'
        method='post'
        anchor='0'
    >
        <cms:if k_success >
        <cms:db_persist_form
            _invalidate_cache='0'
            _auto_title='1'
        />
        </cms:if>


Third Issue:
This isn't specific to DataBound forms I think, but in the context of an Application Form it makes more sense.
So I'm trying to get the options of the open positions to be dynamic, to be able to switch on and off in the backend. This way editors could take job offerings on and offline at any time, without the need to alter the apply form.
I already have a page completely set up where the open Positions are stored in clonable pages (it's basically set up like the blog tutorial, nothing special), but I can't get the open positions to be dynamic.
I tried building a loop with the cms:pages tag, but that didn't work out as I expected, in fact nothing got displayed at all, this is what I did:

Code: Select all
    <cms:set open_positions="Please choose=-" />
    <cms:pages masterpage="applications.php">
        <cms:set open_positions="<cms:show open_positions /> | <cms:show k_page_title />" />
    </cms:pages>

    <cms:editable name='position' required='1' type='dropdown'
        opt_values="<cms:show open_positions />"
    />


And forth (so far last) problem:
The input fields with a type="bound" have an inline style (99% width) when rendered in the front-end. I understand that this is coming from the rendering in the backend, but is there a way to disable this in the front-end? I know I can overwrite it with an !important CSS definition, but I would really like to avoid that if at all possible.


Sorry for the wall of text, I wasn't sure how much details are needed :) If there are any more infos needed, I'm sure I can get more detailed :)

Best regards
Mihawk
Hi :)

First Issue:
Second Issue:

ERROR: Tag "editable" has unknown type "securefile"
ERROR! Unknown tag: "db_persist_form"
Both these errors suggest that 'data-bound-form' addon is not activated in your installation.

Your entry in kfunctions.php file seems fine, though.
So it is a bit puzzling for me. If your setup is online, please get me access to it and I'll take a look. Else you'll have to try and find why 'data-bound-form.php' is not getting included.

Third Issue:
I think a better way to populate a dropdown dynamically would be the following -
viewtopic.php?p=2483#p2483

And forth (so far last) problem:
Please see
viewtopic.php?p=12671
viewtopic.php?p=14724

Hope it helps.
KK wrote: First Issue:
Second Issue:

ERROR: Tag "editable" has unknown type "securefile"
ERROR! Unknown tag: "db_persist_form"
Both these errors suggest that 'data-bound-form' addon is not activated in your installation.

Your entry in kfunctions.php file seems fine, though.
So it is a bit puzzling for me. If your setup is online, please get me access to it and I'll take a look. Else you'll have to try and find why 'data-bound-form.php' is not getting included.

Depends what level off access you would need :/ Backend would be no problem, but I don't have an FTP set up (the development is on a local machine that I can bind to a dynamic dns).

The Form itself is rendered perfectly fine though, it's only those 2 elemets that won't work for some reason. Could it be related to HTTPS? I don't have it enabled on the development machine since I didn't really have the mood to set it up with certificates etc.

Third Issue:
I think a better way to populate a dropdown dynamically would be the following -
viewtopic.php?p=2483#p2483

works perfectly, thanks!

And forth (so far last) problem:
Please see
viewtopic.php?p=12671
viewtopic.php?p=14724

OK, so as suspected, I'll just go with an !important rule for now.
.. but I don't have an FTP set up (the development is on a local machine ..
In that case there really is little I can do to help :(

Perhaps you could try installing a new version (viewtopic.php?f=5&t=8581 or viewtopic.php?f=5&t=8981)?

It is possible some files got corrupt in the existing installation (or something like that). Try with a fresh installation and see how it goes.

Keep me posted. Thanks.
I just extracted the official version again and it is working perfectly fine...

I'm just going to compare the 2 versions now, let's see what's wrong there (KDiff3 to the rescue)...

PS: I just saw that in the kfunctions.example.php there is no closing php tag, shouldn't make a difference but I just wanted you to know ;)
I'm glad it worked :) I'd be interested too in knowing what change was causing the problem. Do share your findings.
I just saw that in the kfunctions.example.php there is no closing php tag, shouldn't make a difference but I just wanted you to know
You should never use the closing ?> bracket in files that get included in other files. It can (and often does) lead to 'Headers already sent' problem. And yes, this could be a cause for the problem you experienced.
So according to KDiff3, there are multiple files broken (mostly just Line Endings though)

aannnd while I'm typing this I just saw ... oh god why
*facepalm* My kfunctions.php may be fine, but the kfunctions.php that couchcms is looking for, is actually this (I moved it the same way the config is being moved):

Code: Select all
<?php
require dirname(dirname(dirname(__FILE__))).'/couch_data/config.php';


I think you spot the error..
Damn copy and paste did it again.

But then why did the other databound fields work perfectly fine? Isn't the editable field of type "bound" defined in the databound forms module?
Isn't the editable field of type "bound" defined in the databound forms module?
'bound' is not an cms:editable region type - it is an cms:input type :)
Yeah sorry, input :D But it is still in the core then right, not in the module?

Seems weird :D I think I would have spotted the mistake earlier otherwise xD

But thanks for your help anyway!
I should really stop using copy and paste for something as simple :)
9 posts Page 1 of 1