VOL-310 Blank screen on CiviVolunteer pages after upgrade to Civi 4.7.21

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Important
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6-2.2.1
    • Fix Version/s: 4.7.21-2.2.2
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Verified?:
      No

      Description

      After upgrading CiviCRM to 4.7.21 from 4.7.20, several Volunteer pages display a blank screen with only the "Volunteer" page title.

      The following pages are affected:

      • Volunteers | New Volunteer Project
      • Volunteers | Manage Volunteer Projects
      • Volunteers | Search For Volunteer Opportunities

      On each of these pages there are the following javascript errors:

      TypeError: CRM.angular.requires is undefined[Learn More] Common.js:1596:5
      CRM.angRequires .../civicrm/js/Common.js:1596:5
      <anonymous> .../civicrm/ajax/volunteer-angular-modules:27:33
      <anonymous> .../civicrm/ajax/volunteer-angular-modules:25:2

      Error: [$injector:modulerr] http://errors.angularjs.org/...
      G/< .../civicrm/bower_components/angular/angular.min.js:6:426
      g/< .../civicrm/bower_components/angular/angular.min.js:40:292
      q .../civicrm/bower_components/angular/angular.min.js:7:369
      g .../civicrm/bower_components/angular/angular.min.js:39:382
      fb .../civicrm/bower_components/angular/angular.min.js:43:381
      c .../civicrm/bower_components/angular/angular.min.js:21:19
      Gc .../civicrm/bower_components/angular/angular.min.js:21:332
      se .../civicrm/bower_components/angular/angular.min.js:20:1
      <anonymous> .../civicrm/bower_components/angular/angular.min.js:323:54
      i .../civicrm/bower_components/jquery/dist/jquery.min.js:2:27444
      fireWith .../civicrm/bower_components/jquery/dist/jquery.min.js:2:28213
      ready .../civicrm/bower_components/jquery/dist/jquery.min.js:2:30004
      K .../civicrm/bower_components/jquery/dist/jquery.min.js:2:30366

      Technical Background

      At or around v4.7.21, CiviCRM introduced new, more elegant ways of creating new Angular base pages and declaring Angular module dependencies for those pages. See https://docs.civicrm.org/dev/en/master/framework/angular/loader/ for details.

      What's a base page? Basically, it's CiviCRM's harness for Angular. It's responsible for things like deciding which Angular modules to load, resolving dependencies, and telling Angular where on the page to embed itself.

      During the development of CiviVolunteer version 2.0 (i.e., well before the release of CiviCRM 4.7.21), it became evident that tacking the extension's Angular module onto CiviCRM core's base page (civicrm/a) was infeasible. CiviVolunteer needed more control over what modules were loaded than the existing programming interfaces would allow. Because all routes are loaded on initialization of the app, various permission checks (e.g., relating to CiviCase) were performed unnecessarily for someone trying to use CiviVolunteer. For use cases where CiviVolunteer users are not admins, these checks resulted in permissions errors that made the system unusable.

      CiviVolunteer addressed this problem by establishing its own Angular base page using the best programming interfaces available at the time: subclassing. Extending classes related to the core base page allowed the extension to exclude troublesome modules from loading on its civicrm/vol base page.

      It would seem that whatever changes were made to these upstream classes to allow the more elegant approach broke the subclasses.

        Attachments

          Activity

          [VOL-310] Blank screen on CiviVolunteer pages after upgrade to Civi 4.7.21
          eric goldhagen added a comment -

          commented too soon, the issue about location or campaign fields, if not null, causing a failure to save a new volunteer event is happening on my instance as well

          Frank J. Gómez added a comment -

          A second beta release is available. The changes between beta1 and beta2 primarily deal with the use case of loading the Angular and Backbone interfaces from inside a CiviEvent tab.

          A problem still persists wherein the settings introduced by CiviVolunteer seem to disappear after upgrading to the beta version. The problem manifests as error messages relating to the location and campaign fields as reported above, and it does not seem to make a difference whether one upgrades by patch or in-app, via the Manage Extensions UI. (I had held out hope that some cache-clearing automagic triggered by the in-app upgrade event would resolve this, but it does not.)

          There have not been any recent changes to the extension's settings, so I suspect the fix to this last remaining problem needs to happen in core rather than in the extension. I have pinged Tim Otten privately with more detail about the problem. In the meantime, site admins can fix the settings problem by running cv flush. Note that other forms of cache-clearing do not appear to resolve the problem.

           

          Agileware added a comment -

          We found an another issue where the select / combo boxes on the page were not picking up changes to the model correctly. PR #458 has a patch to fix.

          Frank J. Gómez added a comment -

          Thanks, Agileware. Tested and merged. Weird that that worked in the older Angular version but not this one. ¯_(ツ)_/¯

          Frank J. Gómez added a comment -

          I've just closed this issue and pushed out a new release and blog post. It may take a while for these to percolate.

          I've opened a core issue (CRM-21210) for details about the settings caching problems that came up in this thread.

            People

            • Assignee:
              Frank J. Gómez
              Reporter:
              Bob Silvern

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 1 hour
                4d 1h