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) »
  • Can't find API Explorer in 1.6/4.0
Pages: [1]

Author Topic: Can't find API Explorer in 1.6/4.0  (Read 2104 times)

corster

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 0
  • CiviCRM version: CiviCRM 4.0.x
  • CMS version: Joomla 1.7.x
Can't find API Explorer in 1.6/4.0
May 03, 2011, 09:16:18 am
Maybe i am missing something very obvious, but we can't seem to access the new API Explorer in our new installation of Joomla 1.6 and CiviCRM 4.0.  Can someone clue us in?


Thanks,
Curtis

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 10:39:37 am
What link do you use?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

corster

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 0
  • CiviCRM version: CiviCRM 4.0.x
  • CMS version: Joomla 1.7.x
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 10:42:28 am
That's the problem, we can't find a "here's the URL you should be using to access the API Explorer".  I see some references to drupal, but nothing for Joomla.  We've tried guessing at it, but nothing seems to work.  I would have expected it to be a menu item in the administration panel.  If you could guide me, i would really appreciate it.


Thanks,

Curtis
Curtis

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 10:51:51 am
Okay, I see...there is a post here: http://civicrm.org/API_version_3. On the demo site for Drupal it is : http://drupal.demo.civicrm.org/civicrm/ajax/doc/api#explorer . I am not sure what that would translate to for Joomla, it is not a menu option!
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

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: Can't find API Explorer in 1.6/4.0
May 03, 2011, 11:03:30 am
the joomla path should be:

http://joomla.demo.civicrm.org/administrator/index2.php?option=com_civicrm&task=civicrm/ajax/doc/api#explorer

but does not seem to work. Would be great if you can take a look and figure it out. the code is here:

CRM/Utils/REST.php, function ajaxDoc

took a quick look at it. The author (xavier_d) assumed it is a drupal install and assumes that jQuery is loaded (which is not true for joomla)

might want to pester him on IRC and get him to make it joomla compliant :) (I suspect promising to help improve the API will give him some incentive)

lobo
« Last Edit: May 03, 2011, 11:06:50 am by Donald 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

corster

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 0
  • CiviCRM version: CiviCRM 4.0.x
  • CMS version: Joomla 1.7.x
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 11:09:20 am
I used the following also:  http://test.mysite.org/joomla/administrator/index.php?option=com_civicrm&task=civicrm/ajax/doc/api#explorer

The page name that is displayed in the browser header says "API Explorer and Generator", the page has the Joomla Administation menus and template, but it's blank otherwise.

I then tried Lobo's URL (modified for my site) and it tries to load the front end of the site and also has "API Explorer and Generator" in the page name header.

I guess we will look at the REST.php file, but if someone else figures it out, please post it here.


Thanks,
« Last Edit: May 03, 2011, 11:17:55 am by corster »
Curtis

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 12:01:07 pm
Hi,

Have to admit never tried on joomla, mea culpa.

Is there a "public" version (demo or your site) I could have a look ? Probably not complex to include the missing scripts, but not being able to see it makes it harder to know what's missing

(js/rest.js and jquery most probably)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

corster

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 0
  • CiviCRM version: CiviCRM 4.0.x
  • CMS version: Joomla 1.7.x
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 12:04:46 pm
Thank you xavier.  I will PM you the information.


Curtis
Curtis

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 12:27:24 pm
Quote from: Donald Lobo on May 03, 2011, 11:03:30 am
http://joomla.demo.civicrm.org/administrator/index2.php?option=com_civicrm&task=civicrm/ajax/doc/api

On drupal, that's civicrm/ajax/doc
shouldn't it be
http://joomla.demo.civicrm.org/administrator/index2.php?option=com_civicrm&task=civicrm/ajax/doc/api

It is using {crmAPI } could it be that it needs something to make it work ?

It doesn't return any content in the page, right ? I'm assuming the way of using smarty is similar and tha'ts the only "different" stuff I can imagine

Is there a debug mode/developer module on joomla that would display more errors ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 01:35:39 pm

lobo's suggestion for CRM/Utils/REST.php
Can you modify the last line (comment it) and add this new one ?

Code: [Select]
    static function ajaxDoc ( ) {

      CRM_Utils_System::setTitle ("API explorer and generator");
      $template = CRM_Core_Smarty::singleton( );
//      return $template->fetch( 'CRM/Core/AjaxDoc.tpl' );
      return CRM_Utils_System::theme( 'page', $template->fetch( 'CRM/Core/AjaxDoc.tpl' ), true );
    }

and in templates/CRM/Core/AjaxDoc.tpl

Can you add at the top

Code: [Select]
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
(hack, just to see if it solves all issues
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

corster

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 0
  • CiviCRM version: CiviCRM 4.0.x
  • CMS version: Joomla 1.7.x
Re: Can't find API Explorer in 1.6/4.0
May 03, 2011, 02:38:29 pm
Hello All,


A huge thank you to Xavier for his assistance!  It works like a charm, but i must caution that there is an acception.

BAD URL:  http://test.mysite.org/joomla/administrator/index.php2?option=com_civicrm&task=civicrm/ajax/doc/api   (with /index2.php?)

...you will be brought to the display side of your Joomla site.  This is not ideal as the display side template usually does not react well to the API Explorer interface.

To make this show correctly in the Adminstration panel of Joomla, you need to use the same URL, but without the "2".

GOOD URL:  http://test.mysite.org/joomla/administrator/index.php?option=com_civicrm&task=civicrm/ajax/doc/api

It's very subtle, but it makes a world of difference.  Please add this fix to the next release.  I can't thank you guys enough!


Curtis
« Last Edit: May 03, 2011, 02:45:35 pm by corster »
Curtis

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Can't find API Explorer in 1.6/4.0

This forum was archived on 2017-11-26.