CiviCRM: Difference between revisions
No edit summary |
use Subpages template |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
{{#ev:vimeo|192125770}} | {{#ev:vimeo|192125770}} | ||
{{Subpages|}} | |||
{{ | |||
== Documentation == | == Documentation == | ||
| Line 55: | Line 53: | ||
== Upgrading == | == Upgrading == | ||
[[{{PAGENAMEE}}/upgrade]] | |||
== Debugging and the CV command-line == | |||
If you have your CiviCRM sending errors to the Drupal Watchdog Log (CiviCRM Administer > System Settings > [https://equality-tech.com/civicrm/admin/setting/debug?reset=1 Debugging and Error Handling]), you can simply navigate to it in the Drupal Admin (Reports > [https://equality-tech.com/admin/reports/dblog Recent log messages]) | |||
There are many tools you can use to debug your CiviCRM instance. | There are many tools you can use to debug your CiviCRM instance. | ||
One of these is the <code>cv</code> tool [https://github.com/civicrm/cv available on Github]. | One of these is the <code>cv</code> tool [https://github.com/civicrm/cv available on Github]. | ||
| Line 140: | Line 128: | ||
<blockquote> | <blockquote> | ||
Custom tokens (based on custom data) can be added for organizations as well. These tokens will not be displayed in the list of available tokens, but can be added manually. The format is {contact.custom_12} | Custom tokens (based on custom data) can be added for organizations as well. These tokens will not be displayed in the list of available tokens, but can be added manually. The format is {contact.custom_12} � where 12 is the ID of the custom data field. To find the custom data field ID, go Administer > Customize Data & Screens > Custom Fields and click �edit� on the field you want to use. Look at the URL. The last part of the URL will be an equal sign and a number (=12). The number (12 in this example) is the id of that custom field. | ||
</blockquote> | </blockquote> | ||
You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and <code>hook_civicrm_tokenValues()</code>. See | You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and <code>hook_civicrm_tokenValues()</code>. See | ||
< | <syntaxhighlight lang="php"> | ||
<?php | <?php | ||
/** | /** | ||
| Line 302: | Line 290: | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
* [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange] | * [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange] | ||
| Line 324: | Line 312: | ||
== Extensions == | == Extensions == | ||
* See [https://civicrm.org/extensions/drupal listing of CiviCRM extensions for Drupal] | * See [https://civicrm.org/extensions/drupal listing of CiviCRM extensions for Drupal] | ||
* [ | * [https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#installing-a-new-extension Installing extensions] | ||
There are multiple ways to use the <code>cv</code> command to download and install extensions: | |||
;Download a published extension from the directory (long name). | |||
:<code>cv dl org.example.foobar</code> | |||
;Download a published extension from the directory (short name). | |||
:<code>cv dl foobar</code> | |||
;Download an unpublished extension (long name and zip URL) | |||
:<code>cv dl org.example.foobar@http://example.org/files/foobar-1.2.zip</code> | |||
;Download a pre-release (alpha/beta) from the directory. | |||
:<code>cv dl --dev foobar</code> | |||
== Developing Extensions == | == Developing Extensions == | ||
| Line 347: | Line 345: | ||
== Database == | == Database == | ||
The database code in CiviCRM is divided into two logical sections: the DAO and the BAO. The BAO holds the "business logic" for objects and extends the DAO. The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "[[wp:Object-relational mapping|ORM]]"). Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class. As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background. | The database code in CiviCRM is divided into two logical sections: the DAO and the BAO. The BAO holds the "business logic" for objects and extends the DAO. The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "[[wp:Object-relational mapping|ORM]]"). Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class. As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background. | ||
< | <syntaxhighlight lang="php"> | ||
// from CRM/core/DAO.php | // from CRM/core/DAO.php | ||
| Line 353: | Line 351: | ||
require_once 'DB/DataObject.php' | require_once 'DB/DataObject.php' | ||
class CRM_Core_DAO extends DB_DataObject | class CRM_Core_DAO extends DB_DataObject | ||
</ | </syntaxhighlight> | ||
In 2009, [https://civicrm.org/node/597 Doctrine was proposed] as a OODB approach instead of an ORM. There are [https://civicrm.org/blogs/dharmatech/data-mapper-pattern-civicrm-architecture-proposal other discussions too] in the "Architecture Series" that are worth reviewing if you want to know more about database development in CiviCRM. | In 2009, [https://civicrm.org/node/597 Doctrine was proposed] as a OODB approach instead of an ORM. There are [https://civicrm.org/blogs/dharmatech/data-mapper-pattern-civicrm-architecture-proposal other discussions too] in the "Architecture Series" that are worth reviewing if you want to know more about database development in CiviCRM. | ||