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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Do we need this code in Wordpress/civicrm.php?
Pages: [1]

Author Topic: Do we need this code in Wordpress/civicrm.php?  (Read 782 times)

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Do we need this code in Wordpress/civicrm.php?
June 11, 2012, 11:13:19 pm
I have been trying to debug CiviCRM to address Issue-9985 (testing for the moment with NextGen), and have traced down the offending code in the Wordpress CiviCRM.php file:

Code: [Select]
//this is require for ajax calls in civicrm
if ( civicrm_wp_in_civicrm() ) {
    $_GET['noheader'] = true;
} else {
    $_GET['mode'] = 'wordpress';
}

If I comment out the:
Code: [Select]
$_GET['mode'] = 'wordpress';the bug is fixed, and I have not been able to find any functionality broken as a result of the code removal. Does anyone know what it does, and if its necessary?

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Do we need this code in Wordpress/civicrm.php?
June 12, 2012, 11:55:50 am
@anthonycamilleri

That does fix the issue with both Nextgen Gallery and Simple Ads Manager.  I have identified one collateral effect however that results from commenting out the code $_GET['mode'] = 'wordpress';

The collateral effect is that the dashboard dashlets for CiviCRM fail to load.
« Last Edit: June 12, 2012, 12:03:16 pm by jmdziba »
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: Do we need this code in Wordpress/civicrm.php?
June 12, 2012, 03:42:54 pm
I'm not sure its related. Following your post, I checked the dashlets on my test-server installation (4.1.2) and they seem to be working fine with that line of code still commented out.

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Do we need this code in Wordpress/civicrm.php?
June 13, 2012, 07:18:07 pm
Anthony has pointed out that the failure I reported above with dashlets failing to launch may be unrelated to commenting out the code he indicated earlier.  He is correct.  I now have the code commented out and the dashlets are loading fine.  Not sure why I had a problem with the dashlets earlier.  So, at this point, still not clear what the code does, and/or whether commenting it out affects anything.
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Do we need this code in Wordpress/civicrm.php?

This forum was archived on 2017-11-26.