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) »
  • entity.get doesn't return api entities defined by extension
Pages: [1]

Author Topic: entity.get doesn't return api entities defined by extension  (Read 434 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
entity.get doesn't return api entities defined by extension
May 06, 2013, 01:59:21 am
Hi,

I want to modify it to take into account the extensions, but might have a performance impact.

I think it's mostly used on api explorer, so shouldn't be a big deal, but wanted to check here first if ok

Thought?

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: entity.get doesn't return api entities defined by extension
May 06, 2013, 02:01:08 am
I feel like it is mostly used in explorer too - although I think it's worth talking to Tim about caching
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

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: entity.get doesn't return api entities defined by extension
May 06, 2013, 11:27:57 am
We made a patch several months back (last year?) to allow entity.get to return entities provided by extensions. Take a look at civicrm_api3_entity_get():

https://github.com/civicrm/civicrm-core/blob/master/api/v3/Entity.php#L9

Note this snippet which scans core as well as any module (CiviCRM module-ext, Drupal module, etc) which has registered on the include_path:

Code: [Select]
<?php
  $include_dirs 
= array_unique(explode(PATH_SEPARATOR, get_include_path()));
  foreach (
$include_dirs as $include_dir) {
    
$api_dir = implode(DIRECTORY_SEPARATOR, array($include_dir, 'api', 'v3'));
     ...
  }

This "worked for me" at the time -- it would be interesting to find out why it's not working for you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • entity.get doesn't return api entities defined by extension

This forum was archived on 2017-11-26.