Apr 1st, 2015, 1:15 PM
It appears form builder's function fb_generate_form($settings) does not check the resource type yet, and serves all resources as css.
See \modules\form_builder\global\code\generator.php , beginning line 256.
This bug also appears in the bug tracker:
Issue #365 ยป JavaScript Form Builder Resource applied as CSS Sheet, when specified as JavaScript type
For the time being, the best option is likely to upload a js file elsewhere, and hard code the script link into your template. That won't achieve what css.php does, as far as access control (It looks like it won't serve resources for a private form unless you're logged in, which is nice to know, if I find a reason for private forms).
Alternately, you can live dangerously, and do this for the current version:
Core 2.2.6
Formbuilder 1.0.7
Copy File:
\modules\form_builder\global\form_resources\css.php
to
\modules\form_builder\global\form_resources\js.php
In the new copy, js.php,
Change line 10:
to:See \modules\form_builder\global\code\generator.php , beginning line 256.
This bug also appears in the bug tracker:
Issue #365 ยป JavaScript Form Builder Resource applied as CSS Sheet, when specified as JavaScript type
For the time being, the best option is likely to upload a js file elsewhere, and hard code the script link into your template. That won't achieve what css.php does, as far as access control (It looks like it won't serve resources for a private form unless you're logged in, which is nice to know, if I find a reason for private forms).
Alternately, you can live dangerously, and do this for the current version:
Core 2.2.6
Formbuilder 1.0.7
Copy File:
\modules\form_builder\global\form_resources\css.php
to
\modules\form_builder\global\form_resources\js.php
In the new copy, js.php,
Change line 10:
PHP Code:
<?php
header("Content-Type: text/css");
PHP Code:
<?php
header("Content-Type: text/javascript");
