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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Custom Component in Custom Extension
Pages: [1]

Author Topic: Custom Component in Custom Extension  (Read 868 times)

Kacper Warda

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.5.9
  • CMS version: Drupal 7
  • MySQL version: 5.5.41-0ubuntu0.14.04.1
  • PHP version: 5.4
Custom Component in Custom Extension
March 11, 2015, 11:12:29 am
I have a custom extension named 'Testextension' and placed in 'tools/extensions/some.dotted.name.of.my.test.extension'. I wanted it to provide a new component but If I create a new entry into 'civicrm_component' table with

name = 'CiviTestextension', and namespace = 'CRM_Testextension'

it looks like the system is searching for Component's 'Info.php' file in 'CRM/Testextension' only in base CiviCRM directory (not including 'tools/extensions' subdirectories). Is it possible to make it work inside my custom extension directory?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Custom Component in Custom Extension
March 11, 2015, 11:20:20 am
I had thought "Extensions" and "Components" were mutually exclusive.
What functionality are you trying to add? Maybe there is another way.
Try asking your question on the new CiviCRM help site.

Kacper Warda

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.5.9
  • CMS version: Drupal 7
  • MySQL version: 5.5.41-0ubuntu0.14.04.1
  • PHP version: 5.4
Re: Custom Component in Custom Extension
March 12, 2015, 03:59:09 am
My goal is to provide a new "group" of Activity Types. There /civicrm/admin/options/activity_type?reset=1 is a list of Activity Types "grouped" by Component so I thought the straight solution would be creating a new Component. It can be exact extend of CiviCase component but we need to be able to distinguish between Activity Type of our "group" and Activity Type of CiviCase. Is there any better / different solution than creating a new Component?

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Custom Component in Custom Extension
March 13, 2015, 02:51:07 pm
Organizing activity-types is potentially a good reason. FWIW, you might experiment with some of the other less-used columns in civicrm_option_value (e.g. visibility_id, is_reserved, filter) to see if they can produce the desired behavior. There's a bunch of nuances in how these are handled - I don't know them all of the top of my head; the only way to is to experiment.

For component_id specifically: I would suggest, as an experimental step, that you temporarily/locally put the new Info.php file in core so that you can proceed with determining whether component_id works as expected. (For example: When you go to various screens in the app, do you see the new activity-types in the right places? In the wrong places? Nowhere at all? Do they work as expected?) If things generally work, then move Info.php back into the extension and we can talk more about patching/fixing the issue in core. If they don't work, then post back about the other problems.

Kacper Warda

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.5.9
  • CMS version: Drupal 7
  • MySQL version: 5.5.41-0ubuntu0.14.04.1
  • PHP version: 5.4
Re: Custom Component in Custom Extension
April 13, 2015, 06:28:30 am
Yes, if I create new Component files (with Info.php) inside the core CRM directory then everything works as expected. Anyway if I move the Component files under my extension it looks like civicrm can't find components Info.php file.

greg275

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.6
  • CMS version: 7
  • MySQL version: 5.6
  • PHP version: 5.5
Re: Custom Component in Custom Extension
May 12, 2015, 04:39:35 am
Can we have a jira created for this and potentially create a pull request for core which will fix this issue with loading components from the extension directory?

We can prepare the pull request.

Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Custom Component in Custom Extension

This forum was archived on 2017-11-26.