Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19813 - Only dispatch through EventDispatcher after booting #10138

Merged
merged 1 commit into from
Apr 11, 2017

Commits on Apr 11, 2017

  1. CRM-19813 - Only dispatch through EventDispatcher after booting

    After merging civicrm#9949, some screens (like the contact-result list or "View
    Contact") reported warnings like:
    
    ```
    Notice: Undefined index: in CRM_Core_BAO_Country::countryLimit() (line 90 of /home/foo/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/BAO/Country.php).
    Notice: Undefined index: in CRM_Core_BAO_Country::provinceLimit() (line 62 of /home/foo/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/BAO/Country.php).
    ```
    
    Bisecting the git history revealed that it stemmed from switching
    `hook_civicrm_entityTypes` to go through EventDispatcher.
    
    civicrm@fb1d9ad#diff-8869a8f3c6318eb0580ce2aa04b713bfL1835
    
    This hook is apparently similar to `hook_civicrm_container` in that both
    fires pre-boot.  If we attempt to dispatch it through the container in a
    pre-boot environment, something initializes incorrectly.
    
    This change proposes a general rule:
     * If you fire a hook before the container or EventDispatcher is available...
     * Then don't try to use the container or EventDispatcher.
    totten committed Apr 11, 2017
    Configuration menu
    Copy the full SHA
    4d8e83b View commit details
    Browse the repository at this point in the history