Search

I was in the process of figuring out the Paypal extension…

While testing, I deleted a couple of test events I created, along with an “Inventory” section, attached to the event, that I had in place to try adding values to.

Now every time I try to save a new event I get this horror:

    in_array() [function.in-array]: Wrong datatype for second argument
/Users/tmslnz/Work/1002-Bedouin_Website/Development Source/extensions/paypal_payments/extension.driver.php line 294

289       $context['options'][] = array('paypal-payments', @in_array('paypal-payments', $context['selected']) ,'PayPal Payments: Reroute to PayPal');
290     }
291     
292     public function add_filter_documentation_to_event($context)
293     {
294 (RED highlighted row)     if ( ! in_array('paypal-payments', $context['selected'])) return;
295
296      $context['documentation'][] = new XMLElement('h3', 'PayPal Payments: Reroute to PayPal');
297         $context['documentation'][] = new XMLElement('p', 'You can pass data to PayPal’s server by mapping fields to most of the variables/fields listed in Website Payments Standard documentation. The example below shows how you would map amount, first-name/last-name and description to their PayPal equivalents:');

I tried uninstalling the extension, and while it’s unistalled I don’t get the error upon creating new events. But as soon as I re-enable it… bang and crash.

I suspect I have to go inside an SQL cave, and look for the offending gremlin. But where to look?

Looks like something may have changed in the way documentation is added to new events since I built the extension. I’m on holiday in Europe sans computer so can’t help out, doesn’t look to be a complex error though so hopefully someone can fork you a fix.

Ouch. Just to be clear, it worked fine until I decided to rollback and do different tests.

BTW, if you are in London let me know, there’s a six-pack waiting ;)

See line 289 how it has the @ in the front of the in_array statement? If you add that to the 294 it should continue on.

It’s just that 2.0.7+ are now more verbose in error messages. The cause your actual error is that $context['selected'] is not an array.

The ‘better’ way to fix it would be to check if $context['selected'] is an array before it’s used.

Cheers. It does what you say. Didn’t know about error reporting suppression by @. Seems a bit dodge, but it works. Surely better than me commenting out the whole add_filter_documentation_to_event method def.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details