Using:
Drupal 7.2
Domain Context 7.x-1.x-dev
Context 7.x-3.0-beta1

I'm pretty new to Drupal (first post to drupal.org in fact), so bear with me if I get the protocols wrong. Apologies in advance.

I recently did some module updates (not context or domain context) on a site in development and ran update.php. It turned out I didn't really need to update (nothing to install) but then when I hit my site again, I got the following:

Fatal error: Class 'context_condition' not found in /Users/jpodhajsky/Documents/drupalsites/xxxxxxxx.edu/trunk/htdocs/sites/all/modules/domaincontext/plugins/domaincontext_context_condition_domain.inc on line 12

The only solution is to re-install the dev database -- I get my site back, but any time I run update.php the same fatal error occurs. This happens consistently on my local copy of the site. I haven't tried it on dev, but I assume the result would be the same. I'm not sure where to begin to resolve this, but I know that sooner or later, I'll need to run an update for real.

I did try updating to the latest dev versions of both Context and Domain Context, but got the same results on update.

Happy to provide more information if anyone has thoughts on a fix.

Thanks for any assistance!

Comments

jpodhajsky’s picture

Also, forgot to mention I'm using Domain Access 7.x-2.12.

iandickson’s picture

Class 'context_condition' not found in /home/likalco/public_html/core/sites/all/modules/domaincontext/plugins/domaincontext_context_condition_domain.inc on line 12

My site is fine with Domain Access 2.12, but I get error on upgrade to 2.13. This is fatal to the site. I've done it twice now and same results both times.

mirlan’s picture

Any workarounds for this?

xjm’s picture

Hmm, so somehow it is not finding the parent class when update.php runs? The parent class is located in context/plugins/context_condition.inc, but this file is not declared in context/context.info. I wonder if that could be the issue?

I don't have time to set up a site to test this as the moment (I'm not running any D7 sites with either DA or Context yet). However, if someone wants, they could try adding the following line to the context module's .info file and seeing if that makes a difference:

files[] = plugins/context_condition.inc

Add this line after the other files[] entries, clear your site cache, and then try the update.php again.

xjm’s picture

Just checked on IRC and supposedly ctools should take care of registering the plugins. (So disregard #4 above.)

xjm’s picture

Is everyone using Drupal 7.2? From merlinofchaos on IRC:

There's a major bug with CTools + registry + Drupal 7.2

It's been worked around in -dev tho I think a long term fix still needs to be done. In short, registry_rebuild() is called in update.php prior to full bootstrap. This means that CTools' hook_registry_files_alter() does not get called and all plugin class files get unregistered.

See: #1170312: After updating to Drupal 7.2 Fatal error: Class 'ctools_export_ui' not found -- #40.

So, three possibilities:

  1. Try removing the following line from domaincontext.info:
    files[] = plugins/domaincontext_context_condition_domain.inc
    
  2. If that does not resolve the issue, try merlin's suggestion in #40 of the issue above
  3. Try the current 7.x-dev build of Drupal core.

Please let me know what works. If #1 resolves the issue, I'll roll a patch.

iandickson’s picture

I am on 7.2 however I have simply avoided Domain Context sinmce the issue arose and now don't use it, so can;t test anything.

jpodhajsky’s picture

I just tried Merlin's fix:

1. Added registry_rebuild() to index.php
2. Cleared cache
3. Hit index.php once
4. Commented out the registry_rebuild() in index.php
5. Cleared cache
6. Ran update.php
7. Immediately got the same error: Fatal error: Class 'context_condition' not found in /Users/jpodhajsky/Documents/drupalsites/xxxxxxx.edu/trunk/htdocs/sites/all/modules/domaincontext/plugins/domaincontext_context_condition_domain.inc on line 12

Also tried removing files[] = plugins/domaincontext_context_condition_domain.inc from domaincontext.info. Ran an update and didn't get the error above, but started getting all sort of other errors...didn't have time to capture them...I'll try this again later and see if I can get a better report.

xjm’s picture

Just a note, another workaround for this might be to simply disable domaincontext before running update.php and re-enable it after.

jarrodirwin’s picture

subscribing as we are having a similar issue (just been informed there is now a 'follow' link...)

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)

Can anyone confirm this is still and issue on latest versions of Context, Domain, Ctools and Drupal Core?

grndlvl’s picture

I did not have this issue with the following setup:
drupal 7.10
ctools 7.x-1.0-rc1
domaincontext 7.x-1.0-alpha1
context 7.x-3.0-beta2

Attempted to replicate by visiting "update.php" and run through w/o updates.

larowlan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Thanks grndlvl
Marking as fixed.

quantos’s picture

Status: Closed (cannot reproduce) » Active

I've just hit the self-same snag. The site, an omega/delta/context/domain access build, and I'm locked out. The exact same build was running great until I simply moved servers and re-uploaded files, then bang, gone. Will re-try and update if I can.

Q.

tessa bakker’s picture

Category: Support request » Bug report
Priority: Normal » Major
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new302 bytes

Hi,

This is still an issue and easy to fix as suggested by xjm.

The patch removes the line and that should be enough to cancel out any error's on registry rebuild.

The line itself will be triggered by hook_context_plugins() and hook_context_registry().

tessa bakker’s picture

StatusFileSize
new238 bytes

New patch without extra patch context, #15 fails with Drush make, because Drupal.org adds version info in .info-files