I have gone through and updated the WorldPay contribution to the 4.7 Forms API. However, I still don't seem to get it right. I get error Fatal error: Cannot create references to/from string offsets nor overloaded objects in /my_drupal_dir/includes/form.inc on line 312

Anyway, I'm posting the file here, in case someone has any suggestion on where this bug comes from. I've gone through the script 100 times, and tried to read up on anything related to the new 4.7 updates, but can't seem to figure it out.

Let me know if anyone has suggestions to where the error comes from, so the new module update can be finished. File attached.

Comments

neclimdul’s picture

When do you get the error so I know where to start looking?

steffen’s picture

In the settings page for WorldPay.

steffen’s picture

Is anyone able to install the attached WorldPay module and go to the settings page, just to see if this is a bug in my system, or if it's a worldpay.module related issue?

I'll submit a patch for it, as soon as the bug has been sorted out.

Thanks!

neclimdul’s picture

StatusFileSize
new11.13 KB

Not quite... I get 'Cannot use string offset as an array in /.../modules/system.module on line 722'. The problem is settings expects a return value of a form array. Here's a patch against CVS that fixes it, cleans up some old comments that seem to be from when it was being written, and fixed the spacing to fit drupal standards. There's still a lot of work that could be done. Namely worldpay_callback_process() is a mess and worldpay_form() should probably be converted to the formapi as well. Also, it seems to be hardcoded for GB. Might want to add a setting for country code.

steffen’s picture

Thanks for the follow up!

steffen’s picture

My initial error seems to have had nothing to do with Worldpay module. It only appeared on the worldpay settings page, and after a full update of all the scripts to latest CVS it's now working. Thanks for the patch!

However, the Worldpay module still seems pretty buggy, unfortunately. When moving from /cart/checkout?op=next to /cart/checkout/process I get a blank page. Must be something wrong with worldpay_submit_form_top or the manual form that is put in to submit information to Worldpay, from approx line 251 and onwards in worldpay.module

neclimdul’s picture

Assigned: Unassigned » neclimdul

:-D funny... That's the page I was refering to fixing. I've got some of the code written for that change but I had some stuff come up. I'll see if I can't free up some time to look at finishing it.

steffen’s picture

Are you able to produce an error from it?

neclimdul’s picture

StatusFileSize
new21.05 KB

See if this does it for you. I took the liberty of cleaning it up a little bit more again.

neclimdul’s picture

Oh and this is going to suffer from the problems mentioned in #54571 so you might not want to have the newest version of cart/address just yet.

neclimdul’s picture

Has anyone tried this? It seems to handle at least the problems listed here as far as I can tell.

neclimdul’s picture

Status: Active » Fixed

This seems to have been done without this patch so... closing it out.

Anonymous’s picture

Status: Fixed » Closed (fixed)