I have two almost identical Drupal 7 installations with Context installed, but one installation has about 20 nodes and the other about 6000 nodes. The installation with 20 nodes works fine, the one with about 6000 nodes has a problem: when I want to edit a context or create a new one, it starts loading.... and then I get a server error. The logs don't show anything out of the ordinary. Is this a memory thing? I can't seem to find a way out.

Comments

chrisjlee’s picture

I'm having this issue as well. I'm trying to edit a context ('admin/structure/context/list/category/edit') and after visiting the url i get a 500 error. Otherwise other context functions are working fine.

dgtlmoon’s picture

silly question but there must be something in your logs or watchdog perhaps?

dgtlmoon’s picture

Status: Active » Postponed (maintainer needs more info)

Do you mean this page? admin/structure/context/add

what does the memory_limit in your phpinfo(); say ?

On my install it uses about 100MB on that page (but this is a large site im working on with many modules etc)

mfgr’s picture

Having looked around, I found that Context absorbs a lot of memory (and I mean A LOT). We have upped the limit to 256 M, and it still takes a minute or more to load. Guess this is an issue for the module; don't know how to get around doing that in a formal way.

dgtlmoon’s picture

How did you test that? I had the same theory too, but turned out to be a lot of memory usage even with this module turned off

goldenboy’s picture

Hi all,

I'm having the same issue. The version of the module I have installed is 7.x-3.0-beta6.
There's no log, no PHP error and no apache log. I think it is a resource demanding issue.
My workaround was:

  1. modify the file context.plugins.inc inside the module folder commenting all the plugins I don't use.
  2. clear the cache
  3. create the context
  4. restore the file

My PHP configuration at the time of the test was:

  1. memory_limit: 512MB
  2. max_execution_time: 360

Sadly, I can't access the MySql configuration.

eminencehealthcare’s picture

I get a server error immediately after installing the module. I cant check server log or anything because I cannot access the site. My memory limit is set to 1024mb. Max execution time is 600. I have 1.4 GB of free memory on my site at idle.

tekante’s picture

The number of nodes shouldn't have an effect on the loading of the add context form but the number of taxonomy terms might. For those having a problem with memory usage do you have large numbers of taxonomy terms? You can also try commenting out the node_taxonomy plugin temporarily to see if that lets the add form load.

That can be done in context.plugins.inc via commenting out these lines

 74     $registry['conditions']['node_taxonomy'] = array(
 75       'title' => t('Taxonomy'),
 76       'description' => t('Set this context when viewing a node with the selected taxonomy terms.'),
 77       'plugin' => 'context_condition_node_taxonomy',
 78     );
erwangel’s picture

I confirm disabling taxonomy enables access to add/edit contexts, or else server 500 error; in my case I have a great number of taxonomy terms (but not so many, 5-6 hundreds using Calais). As said above, comment out the if (module_exists('taxonomy')) test + clear cache before next try. But doing this way means that you can no more use taxonomies in your contexts.

andrebonfanti’s picture

Issue summary: View changes

#8 worked for me too.

I had context/add and context/list/[...]/edit loading and stuck.
I have more than 8.000 taxonomy items in one vocabulary (italian cities).

thanks

renzomb’s picture

We have a huge amount of taxonomys(aprox 60k). In our case we are going on a development pipeline and fork the context module with that plugin commented wasn't a option beacuse we relly on this module and we need it up to date.

So the solution was creating a new module with a hook_context_registry http://www.drupalcontrib.org/api/drupal/contributions%21context%21contex...

And in that module we include a plugin that have the same functionality.
And override the call from context, something like this

function context_condition_taxonomy_term_context_registry_alter(&$registry) {
   if (isset($registry['conditions']['node_taxonomy'])){
     $registry['conditions']['node_taxonomy']['plugin'] = 'crvt_context_condition_taxonomy_term';
   }
}

Its a hotfix because is completly unnecesary load al taxonomy term, so it would be very good a implementation the functionality like choosen that autocomplete with a ajax call or something.
And now that we are here, we also have a taxonomy_not_term, so context execute the reaction if the node doesnt have the taxonomy.
It would be cool have a contributed plugin that allows that.
Maybe someone can point me in the right directions to make this happen :)

dgtlmoon’s picture

Version: 7.x-3.0-beta3 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Active

I can confirm that the number of taxonomy items does cause a memory problem in most reasonable installations, I have 30,000~ terms and using the workaround from #8 (and flush cache) resolved it for me for now, I guess going forwards there needs to be some AJAX type selector for large possible lists of terms (autocomplete of existing terms)

dgtlmoon’s picture

Title: Context not working - server error » Context crashes server when there are a lot of taxonomy terms
steinmb’s picture

Status: Active » Postponed (maintainer needs more info)
Related issues: +#873936: Context UI very slow

People seeing this should try #873936: Context UI very slow There is a working patch in there that might fix this.

badrange’s picture