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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • crmAPI() doesn't work on joomla
Pages: [1]

Author Topic: crmAPI() doesn't work on joomla  (Read 1204 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
crmAPI() doesn't work on joomla
January 26, 2011, 10:34:44 pm
js calls to crmAPI don't work on joomla because the callback url is written in drupalish.
we do call the function a few times in the code successfully by appending the url var and running it through the civi function to cms-ize it.:
ajaxURL: {/literal}"{crmURL p='civicrm/ajax/rest' h=0}"{literal}

not sure if we can do that to the original call by default.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: crmAPI() doesn't work on joomla
January 26, 2011, 10:41:16 pm
Brian,

Can you re-write that & while you are doing it imagine that we haven't a clue what Joomla! requires
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: crmAPI() doesn't work on joomla
January 26, 2011, 11:14:36 pm
for example:

drupal: civicrm/ajax/rest?id=16962&custom_1=Charged&fnName=civicrm%2Fcontribution%2Fadd&json=1

joomla: administrator/index2.php?option=com_civicrm&task=civicrm/ajax/rest&id=16962&custom_1=Charged&fnName=civicrm%2Fcontribution%2Fadd&json=1


...so joomla prepends "administrator/index2.php?option=com_civicrm&task=" -- but also should not have a second question mark (drupal appends get variables after the civi path call, but joomla has already constructed the url with get vars)
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: crmAPI() doesn't work on joomla
January 27, 2011, 12:01:14 am
Hi,

I'm a bit confused with the include path on joomla. I'm sending you a patch I think will solve this.

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

apotropaic

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 1.8
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: crmAPI() doesn't work on joomla
March 27, 2011, 01:28:13 am
Hey lcdweb, have you figured this out? My issues is when on Joomla and I try to use a url structure like this:

/administrator/index2.php?option=com_civicrm&task=civicrm/ajax/rest&fnName=civicrm/entity_tag/get&json=1&entity_id=1

it asks me to authenticate for the joomla admin. Once I am logged in it works fine. I think the only way around this to point to an actual file, right?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: crmAPI() doesn't work on joomla
March 27, 2011, 01:59:47 am
Hi,

That's normal, you need to be authenticated to use the ajax interface.

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

apotropaic

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 1.8
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: crmAPI() doesn't work on joomla
March 27, 2011, 02:06:23 am
Oh, I guess I thought it has some function for frontend use as well. So for an external access I should really be using the REST api?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: crmAPI() doesn't work on joomla
March 27, 2011, 02:39:24 am
yes
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • crmAPI() doesn't work on joomla

This forum was archived on 2017-11-26.