Page 1 of 1

FormBuilder module - fatal error using 'xml form import'

Posted: Tue Dec 09, 2008 10:13 pm
by alanchill
Hi,

I've encountered an issue on two implementations of CMSMS and FormBuilder.  On both (on several occasions on each) I've tried to export an existing form from within FormBuilder and then import it (either into the same CMSMS implementation to create a duplicate form, or to a different CMSMS install - eg moving a project from localhost to live.  On each occasion I get the errors on screen after what appears initially to be a successful install:

Code: Select all

Warning: fbForm::require_once(<path>\modules\FormBuilder\classes/Field.class.php) [fbform.require-once]: failed to open stream: No such file or directory in <path>\modules\FormBuilder\classes\Form.class.php on line 1142

Fatal error: fbForm::require_once() [function.require]: Failed opening required '<path>\modules\FormBuilder\classes/Field.class.php' (include_path='.;C:\php5\pear') in <path>\modules\FormBuilder\classes\Form.class.php on line 1142
For reference, line 1142 of the Field.class.php file contains:

Code: Select all

require_once dirname(__FILE__).'/'.$classFile;
Any attempt to then navigate into the particular form also produces this same error on screen.  As does attempting to delete it.

I've seen a German post mentioning the same thing, but I only speak "ein bisschen deutsch" to not able to understand the full nature of what was happening.

Anyone else have any ideas?

Thanks

Alan

Re: FormBuilder module - fatal error using 'xml form import'

Posted: Thu Dec 11, 2008 10:22 am
by janb
Hi

I had the same problem.
Field.class.php does not exist (and should not either i think) , so i just touch the file to create an empty one :-)

Code: Select all

touch <path>/modules/FormBuilder/classes/Field.class.php
JanB

Re: FormBuilder module - fatal error using 'xml form import'

Posted: Thu Dec 11, 2008 10:26 am
by Dee
Check this bugreport.

Regards,
D

[SOLVED] Re: FormBuilder module - fatal error using 'xml form import'

Posted: Sat Dec 13, 2008 11:45 am
by alanchill
Hi,

I'm happy to say the problem is solved.

I added blank file into the /modules/formbuilder/classes folder called "field.class.php" as per janb's suggestion.

This worked immediately on my localhost - so have tried uploading a blank file through FTP to do the same on my remote hosted site.  Glad to say this worked a treat too.

For consistency I then applied the change that Dee suggested - which was to use the the line

Code: Select all

require_once cms_join_path(dirname(__FILE__), $classFile);
This also works and just makes slash direction consistent, should it ever become significant again.

I realise now too that I was a bit of a numpty in not spotting the different files in the error message - the error was from form.class.php and it pertained to a file called field.class.php.  I didn't spot the difference and thought they both mentioned form - causing me to think that it was an odd error. 

Anyway, happy to set the subject to SOLVED now, many thanks for the assistance in sorting this so quickly.