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 »
  • CiviVolunteer (Moderators: GinkgoFJG, Michael Z Daryabeygi) »
  • Can CiviVolunteer work under Drupal6
Pages: [1]

Author Topic: Can CiviVolunteer work under Drupal6  (Read 1441 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Can CiviVolunteer work under Drupal6
May 28, 2014, 02:41:29 am
Has this extension been tested or used successfully under Drupal6?

I installed it using the back office UI, and no errors were reported.

After enabling volunteering for a specific event, the buttons for "Define Volunteer Needs" , "Assign Volunteers" and "Log Volunteer Hours"  appeared as expected.   But when I click the button "Define Volunteer Needs", nothing happens. I turned on Firebug, and I see the following errors in the console:

Code: [Select]
ReferenceError: Backbone is not defined
https://mygroup.org/sites/default/files/js/js_5a75c378959cc2a68473c8a024fc6b01.js
Line 11

ReferenceError: Backbone is not defined
js_5a75c378959cc2a68473c8a024fc6b01.js()js_5a7...6b01.js (line 11)


ReferenceError: Backbone is not defined
CRM.volunteerApp = new Backbone.Marionette.Application();




Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Can CiviVolunteer work under Drupal6
May 28, 2014, 03:44:21 am
Can you try to disable "Optimize JavaScript files" on admin/settings/performance and see if that helps?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

GinkgoFJG

  • Moderator
  • I post frequently
  • *****
  • Posts: 135
  • Karma: 4
    • Ginkgo Street Labs
Re: Can CiviVolunteer work under Drupal6
May 28, 2014, 04:08:26 am
Can't think of why it wouldn't work in D6. Please do as Herschel suggested; it will make it easier to debug your problem. Is your path for extension resources correct?
Are you a CiviVolunteer user? Join the CiviVolunteer 2.0 Matching Grant effort to help the project win $15,000 in grant funding.

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can CiviVolunteer work under Drupal6
May 28, 2014, 08:33:38 am
The value for "Extension Resource URL"   is  https://mygroup.org/pogstone_extensions/  (Which looks right to me, as that is my extension folder)

The good news: When I disabled the Drupal setting "Optimize JavaScript files", then CiviVolunteer works as expected!  ( I also cleared the Drupal cache for good measure)

The bad news: When I re-enable the Drupal setting "Optimize JavaScript files", then I get the original problem on this thread.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Can CiviVolunteer work under Drupal6
May 28, 2014, 08:49:22 am
We will leave the solution therefore, as an exercise for the reader. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

GinkgoFJG

  • Moderator
  • I post frequently
  • *****
  • Posts: 135
  • Karma: 4
    • Ginkgo Street Labs
Re: Can CiviVolunteer work under Drupal6
May 28, 2014, 10:54:09 am
Interesting discovery. Well, as Hershel suggested, the short-term fix is simple -- suffer the un-optimized resources.

CiviVolunteer adds JS files "the Civi way", so I suspect the problem is upstream. I haven't looked at how the code in core works, but I suspect CRM_Core_Resources or the Drupal integration code adds a wrapper around Drupal's drupal_add_js function.

Assuming that the error you're experiencing can be reproduced reliably, this would suggest that the extension framework isn't passing along extension-included scripts, which would suggest a problem in core or in the D6 integration. This is pure speculation, of course. I'd need to reproduce the problem and get into the code to tell you more.

Do you experience the same problem when you enable "Optimize JavaScript files" for your D7 sites?

If you'd like us to look into this more, please create an issue in JIRA.
Are you a CiviVolunteer user? Join the CiviVolunteer 2.0 Matching Grant effort to help the project win $15,000 in grant funding.

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can CiviVolunteer work under Drupal6
May 28, 2014, 06:33:20 pm
I did some more research, comparing the results with CiviVolunteer under Drupal7 and Drupal6.

In Drupal7, I have JavaScript optimization turned on. Yet there are no problems. I looked at the source to see what .js files are included. Here is a snippet from Drupal7 (with JS optimization turned on):

Code: [Select]
sites\/all\/modules\/civicrm\/js\/jquery\/jquery.crmasmselect.js":1,"1":1,"sites\/all\/modules\/civicrm\/packages\/backbone\/json2.js":1,"sites\/all\/modules\/civicrm\/packages\/backbone\/underscore-min.js":1,"sites\/all\/modules\/civicrm\/packages\/backbone\/backbone-min.js":1,"sites\/all\/modules\/civicrm\/packages\/backbone\/backbone.marionette.min.js":1,"sites\/all\/modules\/civicrm\/js\/noconflict.js":1,"sites\/all\/libraries\/superfish\/jquery.hoverIntent.minified.js":1,"sites\/all\/libraries\/superfish\/jquery.bgiframe.min.js":1,"sites\/all\/libraries\/superfish\/superfish.js":1,"sites\/all\/libraries\/superfish\/supersubs.js":1,"sites\/all\/libraries\/superfish\/supposition.js":1,"sites\/all\/libraries\/superfish\/sftouchscreen.js":1,"sites\/all\/modules\/views_slideshow\/js\/views_slideshow.js":1,"modules\/toolbar\/toolbar.js":1},"css":{"modules\/system\/system.base.css":1,"modules\/system\/system.menus.css":1,"modules\/system\/system.messages.css":1,"modules\/system\/system.theme.css":1,

On Drupal6 with JavaScript optimization turned on, none of that gets included. (Nor included in the optimized .js files auto-generated by Drupal6.

What concerns me in general ( not just related to CiviVolunteer) is that CiviCRM and CiviCRM extensions that add .CSS files and .JS files to the output are NOT getting included in the Drupal autogenerated optimized files when optimization is turned on. (This is happening under BOTH Drupal 6 and Drupal 7)  This is a huge risk because end-users using Internet Explorer will be SOL because IE limits the total number of css/js files that a single page can use.

BTW: I can reproduce the issue on demand

Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can CiviVolunteer work under Drupal6
May 29, 2014, 10:10:04 am
I created a JIRA issue:  https://issues.civicrm.org/jira/browse/VOL-49
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions »
  • CiviVolunteer (Moderators: GinkgoFJG, Michael Z Daryabeygi) »
  • Can CiviVolunteer work under Drupal6

This forum was archived on 2017-11-26.