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) »
  • Is this possible to install+enable in one step?
Pages: [1]

Author Topic: Is this possible to install+enable in one step?  (Read 1759 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Is this possible to install+enable in one step?
May 27, 2013, 10:17:13 pm
Hi,

when I'm installing an extension that I have git cloned (ie. I have already the files in the extension folder), it needs two steps

drush civicrm-api extension.install key=eu.tttp.qlookup
drush civicrm-api extension.enable key=eu.tttp.qlookup

If I enable directly, I get "Can only enable extensions which have been previously installed"

Is there a way to enable in one step extensions that are already "installed"? eg a options.force=1?

X+

P.S. yes, I'm that lazy. And when you work on an extension that does a lot of stuff when you enable/install and you want to debug, you do it quite a few times per hour...
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Is this possible to install+enable in one step?
May 27, 2013, 10:45:44 pm
Hmm, there's something fishy. You shouldn't need to call Extension.enable at all -- Extension.install should take care of everything. If "Extension.enable" is necessary, then that's a bug in 4.2.x.

A few thoughts:
 * Maybe there's some cache that's no longer flushing appropriately? If it's easy to reproduce the problem, you might try doing: "drush civicrm-api extension.install key=eu.ttp.qlookup" and then "drush civicrm-api system.flush".
 * When I was using 4.2.x, this was never necessary.
 * When testing this, are you working on a site/database that has previously had the extension? "Enable" is supposed to be the anecdote to "disable" -- that's all.
 * There were times when one needed to delete the "tmp" / "cache" subdirs from the extension dir. From the description, I don't think it's necessary in this use-case, but maybe there's some detail that we're not thinking of.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Is this possible to install+enable in one step?
May 27, 2013, 11:42:24 pm
Damn, might simply be me that didn't try to only run install, was trying to only run enable

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

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Is this possible to install+enable in one step?
May 31, 2013, 02:15:58 pm
FWIW, in 4.3, the "install" and "enable" actions do the same thing -- both wind up calling CRM_Extension_Manager::install() (which then decides whether to run the first-time install logic or the re-enable logic).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Is this possible to install+enable in one step?

This forum was archived on 2017-11-26.