Skip to content
Commit ad024b4a authored by DeFr's avatar DeFr
Browse files

Bug #1525802 by DeFr: Fix a fatal error at the end of the request

Previously, jstats_callback used drupal_write_record to insert the
record into the {jstats_acceslog} table: due to Schema API internals,
this meant that the whole schema was loaded, and
DrupalCacheArray::__destruct was trying to save it to the cache
when all the objects get destructed by PHP. However, the request
never went farther than DRUPAL_BOOTSTRAP_DATABASE, which means that
lock.inc isn't loaded, so lock_acquire isn't defined.

With this patch, jstats_callback now simply does a straight db_insert,
bypassing Schema API and thus fixing the problem.

It should also have a positive impact on performance: the old code
triggered the loading of all the .install file to build the schema,
that doesn't happen anymore.
parent 3356d11b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment