Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 May 2009 at 16:40 UTC
Updated:
30 Jun 2009 at 08:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
bjaspan commentedI have no objection to this. The whole reason we moved field revision storage to separate tables is to make the more important activity of using the current revision more efficient.
Comment #2
yched commentedPatch attached.
- Adds a few checks to the existing testFieldAttachCache(),
- abstracts random values generation, used all over FieldAttachTestCase tests, to a helper function.
- removes an unneeded check for isset($info['cacheable']) in _field_attach_extract_ids() - _field_info_collate_types() ensures there's a default value.
Comment #3
yched commentedOops, not sure what happened, previous patch had borched indentation.
Comment #4
bjaspan commentedVery nice.
Comment #5
yched commented_field_attach_load() : We now check for $cacheable outside the "foreach(object) {fetch from cache}" loop, but I forgot to remove the previous test inside the loop.
Comment #6
yched commentedRerolled after #362024: Field Attach: Make hook_field_load() be 'multiple' like field_attach_load(). CNR for the bot.
Comment #8
yched commentedSmall foobar while manually rerolling the testFieldAttachCache test. Should be exceptions-free now.
Comment #9
yched commentedDoesn't seem to apply cleanly on webchick's setup, reroll
+ fixes one more missing t() in test asserts.
Comment #10
webchickOk, cool. yched walked me through this one a bit as well.
Aside from some minor neatness tweaking here and there, the patch basically does two things:
- Changes caching to be based on the entity ID rather than its revision ID, so that we greatly reduce the bloat of what we're caching and get all the benefits outlined in yched's initial post. This is also consistent with the latest iteration of the node_load cache patch, so we'd be consistent with that if it gets committed.
- Creates a new _generateTestFieldValues() function which encapsulates the typical:
logic found in just about every test. This makes a nice clean-up which makes the test code easier to read.
Maybe I'm getting tired (or maybe this is a fantastic patch! ;)), but I couldn't really find much to complain about here. It's just re-ordering the logic a bit and changing the affected sections of the code, and has both field API maintainers' thumbs up on it.
I fixed one minor indentation thing and then committed to HEAD. Thanks!
Comment #11
yched commentedEr, oops. My reroll in #8 reverted some cleanups in testFieldAttachCache() that were added in #362024: Field Attach: Make hook_field_load() be 'multiple' like field_attach_load().
The idea is that when doing a series of field_attach_save(), field_attach_load(), field_attach_update(), we should reset the $entity each time, so that $entity->field_foo entries set in a previous step do not pollute the next ones. Those changes were in the 'field_attach_load() multiple' patch, not out of pure sadism towards kittens, but to fix actual test hiccups with the patch.
CNR for the bot, but should be RTBC if the bot comes out green.
Comment #12
yched commentedTests OK.
Comment #14
dries commentedCommitted to CVS HEAD. Thanks.