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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Invoking cli.php gives notice 'undefined index'
Pages: [1]

Author Topic: Invoking cli.php gives notice 'undefined index'  (Read 1694 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Invoking cli.php gives notice 'undefined index'
August 25, 2012, 05:22:57 am
Symptoms

When I invoke cli.php via PHP CLI with CiviCRM 4.1.3 and Drupal 7.15 I get notices ...

Quote
Notice: Undefined index: REQUEST_METHOD in drupal_page_is_cacheable() (line 1077 of /var/www/citybibleforum/includes/bootstrap.inc).
Notice: Undefined index: SERVER_SOFTWARE in require_once() (line 13 of /var/www/citybibleforum/includes/mail.inc).

Fix

I observe that Drupal's scripts/drupal.sh defines the defaults for these variables as ...

Code: [Select]
$_SERVER['SERVER_SOFTWARE'] = NULL;
$_SERVER['REQUEST_METHOD']  = 'GET';

The notices disappear when I set these variables in the _bootstrap() function in CiviCRM's bin/cli.php

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Invoking cli.php gives notice 'undefined index'
August 27, 2012, 04:18:09 am
That works.  In civi 4.2 the code goes in cli.class.php.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Invoking cli.php gives notice 'undefined index'
March 10, 2013, 11:45:21 pm
Has this been commited?  This may be a helpful reference: http://api.drupal.org/api/drupal/scripts%21drupal.sh/7

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Invoking cli.php gives notice 'undefined index'
March 18, 2013, 04:00:52 am
No, it hasn't been committed.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Invoking cli.php gives notice 'undefined index'
March 18, 2013, 08:07:14 am

Can you please verify that this is till an issue in 4.3. If so, please file an issue along with a patch and/or pull request (we prefer the latter now)

Note that posting issues and patches on the forum do not make it into the code base in most cases

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Invoking cli.php gives notice 'undefined index'
March 22, 2013, 04:29:22 pm
lobo,

This is also an issue for 4.3. I've created issue CRM-12196 which includes a patch.

Ken

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Invoking cli.php gives notice 'undefined index'

This forum was archived on 2017-11-26.