CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Coming Events php block error
Pages: [1]

Author Topic: Coming Events php block error  (Read 408 times)

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
Coming Events php block error
December 12, 2012, 08:22:07 am
Folks:

I am trying to use the PHP code found here in a block on my front page.  But when I put the newly created block in the Main Content category, I get this error on the front page:

Quote
Notice: Undefined offset: 1 in eval() (line 26 of /home/fairhou1/public_html/modules/php/php.module(80) : eval()'d code).
Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /home/fairhou1/public_html/includes/common.inc on line 2263 and defined in drupal_http_build_query() (line 486 of /home/fairhou1/public_html/includes/common.inc).

Once I disable the block, all is well.

The block is configured as PHP, so that shouldn't be an issue.  Has the code perhaps changed for use with Drupal 7?

Thanks.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Coming Events php block error
December 16, 2012, 10:30:46 am
That code is quite old in reality. It was written for Drupal 6 and for the CiviCRM API version 2. Now you are have Drupal 7 and CiviCRM API version 3. The code will need to be rewritten.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
Re: Coming Events php block error
December 19, 2012, 09:28:54 am
Thanks, Hershel.  That was my fear.  Unfortunately I'm not well-versed in PHP.  If I can find someone to rewrite that code, I'll contribute it to the community.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Coming Events php block error

This forum was archived on 2017-11-26.