Ticket #1075 (closed enhancement: fixed)

Opened 14 months ago

Last modified 10 months ago

Versionable bugfixes and getVersions function added

Reported by: tuct Owned by: jwage
Priority: major Milestone:
Component: Versionable Version: 0.11.0
Severity: Keywords:
Cc: Has Test: no
Status: Pending Core Response Has Patch: no

Description (last modified by jwage) (diff)

the Versionable / AuditLog? feature had some bugs:

tableName could not be set (fixed)
when deleting the Versions have not been deleted (fixed)
when revert an object and save without setting a property the object was not saved (fixed)
when revert to version 1, change a value and save, dublicate entry error was raised because of wrong calculation of the actual version number

moved ->revert($version) from Doctrine_Record to Versionable teamplate

Attachments

Doctrine_AuditLog_getVersions.patch (2.0 KB) - added by Jon.Collins 14 months ago.
patch for getVersions()
Doctrine_Versionable_revert.patch (2.4 KB) - added by Jon.Collins 14 months ago.
patch for moving revert() from Doctrine_Record
doctrine_versionable.patch (14.9 KB) - added by tuct 14 months ago.
for the 0.11 branch

Change History

Changed 14 months ago by tuct

  • summary changed from Versionable fixed and getVersions added to Versionable bugfixes and getVersions function added

Changed 14 months ago by jwage

  • description modified (diff)

Changed 14 months ago by jwage

I am unable to apply your patch to the 0.11 branch to test it out. Can you check this out?

Changed 14 months ago by Jon.Collins

patch for getVersions()

Changed 14 months ago by Jon.Collins

patch for moving revert() from Doctrine_Record

Changed 14 months ago by Jon.Collins

Should the default behavior of getVersions() return the newest version first? The commented line achieves that.

This function would ideally provide a way to let the user attach criteria to the query (to reverse the ordering, for example)

Changed 14 months ago by tuct

for the 0.11 branch

Changed 14 months ago by tuct

it is possible to parse a Doctrine_Query to getVersions (for filtering and sorting) if nothing is parsed the versions are sorted by version col DESC

tests are also updated

btw: i have 19 failing tests with the 0.11 branch (on a clean checkout)

Changed 14 months ago by Jon.Collins

In getVersions(), did you mean to hydrate into $obj_class instead of $className?

Also, isn't getMaxVersion() just the current value of the version column for the record? There shouldn't be any reason to query the version table.

Changed 13 months ago by jwage

  • milestone changed from 0.11.3 to 0.11.1

Changed 13 months ago by jwage

  • status changed from new to closed
  • resolution set to fixed
  • has_patch unset
  • mystatus set to Pending Core Response
  • has_test unset

fixed by r4503

It would make things simpler to open individual tickets and have individual tests for each piece of functionality. I did not implement the new features, only the bug fixes. Please open a different ticket for the individual issues.

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.