Adding JS in 6.x-2.1 creating errors

gwlangie - July 1, 2008 - 16:13
Project:Webform
Version:6.x-2.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active (needs more info)
Description

quicksketch,

I upgraded to the above version and things are now broken. My javascript within my form doesn't work and when I submit my form, the result page doesn't display. I get and error "Fatal error: Cannot use object of type stdClass as array in /home/jane0362/public_html/gbr/includes/common.inc(1537) : eval()'d code on line 20".

I have downgraded to the beta version (doing so solved my problems) for the time being but I need to use the latest version so I can use theme functionality.

#1

quicksketch - July 1, 2008 - 16:48

Hm, I'm not sure how this would break javascript, there aren't any changes to any javascript in the 2.1 version (Webform hardly uses any JS really).

Also... the error included above:

Fatal error: Cannot use object of type stdClass as array in /home/jane0362/public_html/gbr/includes/common.inc(1537) : eval()'d code on line 20

Doing some research on this, common.inc line 1537 is part of the core drupal_eval() function, which Webform doesn't use, so it's unlikely that Webform is causing that problem. It means that somewhere on your site (possibly a CCK field) PHP code entered by the end-user is causing an error (on line 20 of the custom code).

#2

gwlangie - July 1, 2008 - 17:02

I am not sure myself. Maybe there is more than one problem or maybe they are related.

I load the script using "drupal_add_js('misc/paypal/tickets.plugin.js');".

#3

quicksketch - July 1, 2008 - 17:05

And you're theming the webform itself correct (in the new webform-form.tpl.php)? Is the JS ever added to the page at all?

#4

gwlangie - July 1, 2008 - 17:47

I am not theming at this time. Would I need to add the JS to the webform-form.tpl.php?

I can't upgrade to the latest version at this time. The form is being used on the site. Is it possible to copy the form to a diff site?

#5

quicksketch - July 1, 2008 - 17:58

Sorry I thought you meant that you were theming the form. Where are you adding the JS to page?

As for copying the form: there isn't a mechanism for doing this (it is a feature request though #236220: Import function for webform?). I'd recommend setting up a mirror of your site for development purposes and experiment there rather than on the live site. I like the Backup and Mirgrate module for creating database backups.

#6

quicksketch - July 23, 2008 - 02:44
Title:JS changes in 6.x-2.1 creating errors» Adding JS in 6.x-2.1 creating errors
Category:bug report» support request
Priority:critical» normal
Status:active» active (needs more info)

Moving to support. If you have any other possible information please post it. I'll need to know how you're adding JS to the page or where you're including PHP code in order to reproduce the problem.

 
 

Drupal is a registered trademark of Dries Buytaert.