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) »
  • Installing CiviDiscount
Pages: [1]

Author Topic: Installing CiviDiscount  (Read 1068 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Installing CiviDiscount
November 04, 2013, 04:44:09 am
Apologies if this is not the right place to seek support re: using extensions.

Having just upgraded a site to 4.4.0 I decided it was time to move to the platform independent CiviDiscount Extension in place of the older Drupal module. Duly set up the path and url settings within CiviCRM so it could identify the location for extensions files.
Then went to Download and install the Cividiscount extension, and got two error messages:

"Unable to extract the extension", and
"Extension Upgrade Failed: Download failed - ZIP file is unavailable or malformed."

I'll seek to work round this by extracting the files locally and then uploading, but would appreciate any insight as to why this isn't working. Is there something that needs to be enabled on the server in that zip files can be extracted? Can't seem to locate any specific support forum or documentation on the extensions...

Thanks for any input.

Regards
Graham
Graham Mitchell
http://mc3.coop

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Installing CiviDiscount
November 04, 2013, 08:35:39 am
I don't think migration drupal module to extension is fully supported. I would recommend fresh install of CiviDiscount extension. Make sure you back / rename old discount tables.

Hth
Kurund
Found this reply helpful? Support CiviCRM

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Installing CiviDiscount
November 04, 2013, 12:01:26 pm
I think the first error ("Unable to extract the extension") is the main error (and the second error arises because of the first). FWIW, here's where that error is raised in the code:

https://github.com/totten/civicrm-core/blob/232624b1bfe3beee7476775b278b9509e1607487/CRM/Extension/Downloader.php#L151
https://github.com/totten/civicrm-core/blob/232624b1bfe3beee7476775b278b9509e1607487/CRM/Extension/Downloader.php#L173

A few theories:

1. (This probably isn't the issue, but it's easy to test/eliminate.) The URL to the extension's ZIP file could be bad. In the "Manage Extensions" screen, you can expand the section for "CiviDiscount Module Extension" and copy the value from "Download location". Then download that file on your own and see if it's a valid zip file.

2. The server which is running PHP/Civi might not be configured properly to download files. In the past, we've encountered issues when php-curl is missing or when php-curl has a bad SSL configuration.

3. The server which is running PHP/Civi might be subject to some kind of firewalling/filtering/proxying that interferes with the download.

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Installing CiviDiscount
November 04, 2013, 12:59:19 pm
Many thanks for the feedback on this.

In terms of migration, I've simply disabled the old Drupal module, assuming that it would simply be a case of switching off the old module and effectively starting again with the extension. And for this use case, that's just fine.

Thanks totten for the insights - extremely helpful. I've since tried to install a couple of other extensions, with the same outcome, so my assumption is that it is a server -related issue. I'll take that up with my hosting provider and we'll see where that gets us. If I learn anything I'll aim to post that here.

Graham
Graham Mitchell
http://mc3.coop

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Installing CiviDiscount
November 05, 2013, 06:40:59 am
Edging towards resolving this:

My hosting provider confirmed the following:

1. It is not a simple permissions issue. The directory that I set up to hold the extensions files has suitable permissions to enable CiviCRM to do what it needs. It's not a firewall issue.

2. My provider thinks that your second point is where it is going wrong. They report that by default a number of PHP functions are disabled:
disable_functions = dl,exec,passthru,pcntl_exec,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,syslog,system,system_exec

php-curl is installed

Any thoughts on what needs to be enabled to get CiviCRM Extensions to download and install without errors?

Thanks again
Graham
Graham Mitchell
http://mc3.coop

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: Installing CiviDiscount
November 15, 2013, 06:36:58 pm
I was getting the same error, but was trying to upgrade from CiviDiscount extension version 1.0 to 2.4 (not from the Drupal module), and the extension installer did work for the groups2summary extension (have you tried that one?). I asked on IRC, and it turned out that there was an error in the extension's metadata, so dlobo fixed it and issued a new release, CiviDiscount 2.5, and that one worked just fine, and all my old discount codes still work. Your case might be different, since you're migrating from the Drupal module, not the extension v1.

Thanks to totten and dlobo for figuring this out!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Installing CiviDiscount

This forum was archived on 2017-11-26.