You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a model exists where 'id' is not a column and is replaced with any number of other columns as the primary key (disregarding the necessary temporal_start and temporal_end columns that are part of the pk), the following functions fail, since their queries hardcode the use of the 'id' column:
find_revisions_between, find_revision, restore, and purge
Say that Model_Foo extends Model_Temporal and it as a primary key of:
So instead of "id", it uses "foo" + "bar". Well the find() function handles this just fine when you pass an array for a compound key find(array('foo' => 1, 'bar' => 2)):
This fix should be able to be thrown into find_revision and find_revisions_between. It will probably need to be bit different for restore and purge but it should be similar. I'll try to implement the fix and create a pull request from my fork when I get the chance. But wanted to make sure the issue was known before I forget about it.
The text was updated successfully, but these errors were encountered:
If a model exists where 'id' is not a column and is replaced with any number of other columns as the primary key (disregarding the necessary temporal_start and temporal_end columns that are part of the pk), the following functions fail, since their queries hardcode the use of the 'id' column:
find_revisions_between, find_revision, restore, and purge
Say that Model_Foo extends Model_Temporal and it as a primary key of:
So instead of "id", it uses "foo" + "bar". Well the find() function handles this just fine when you pass an array for a compound key
find(array('foo' => 1, 'bar' => 2))
:But the column "id" is hard coded into the query in the functions listed at the top:
Example issue from find_revision():
Example issue from restore():
Suggested fix: Do something similar to what find() does to deal with compound keys. Here's a fix I have written up for find_revision:
This fix should be able to be thrown into find_revision and find_revisions_between. It will probably need to be bit different for restore and purge but it should be similar. I'll try to implement the fix and create a pull request from my fork when I get the chance. But wanted to make sure the issue was known before I forget about it.
The text was updated successfully, but these errors were encountered: