Currently the Entity API does not support revisions for entities. In talks about D8 entities, it has been mentioned that a CRAP (create read archive purge) approach will be taken for how entities are handled. I think that I would like for this to be implemented in ECK. New revisions of an entity will be stored by default every time an entity is updated.

This issue was dependent on #996696: Support revisions in Entity API, but it has been committed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tinyrobot’s picture

After talking with EclipseGc I think that it would be reasonable to hold all the revisions for all eck created entities in one table. ECK uses the same simple schema for all created entities, so I think that this could be reasonable, and it would keep us from junking up the database with more tables. Does anybody see any issues with this?

fmizzell’s picture

Status: Active » Postponed

I think I am cooking something that might be better than core revisions.. we will see

rooby’s picture

Version: » 7.x-2.x-dev

There has been work done on revisions for entity API here #996696: Support revisions in Entity API

Since this modue is using entity API I would think it should build on top of that.

The patch is in a usable state but fago has not reviewed it in a while.
It would be good to get more people testing that patch so maybe this module can be used to test it some more.

rooby’s picture

Status: Postponed » Active

The patch in #996696: Support revisions in Entity API has been committed now.

lpalgarvio’s picture

lpalgarvio’s picture

Title: Revisions » Support Revisions in ECK
Issue summary: View changes
lpalgarvio’s picture

tregismoreira’s picture

Any news?

fmizzell’s picture

@tegrismoreira This is a set goal for 3.x .. currently I am trying to get a stable version of 2.x (I think I am about a week away from that). After that I will get busy with 3.x to get an alpha out. After that I plan to work on revisions and tightening up multilingual support. So, given that schedule we might not see revision in the near feature unless someone awesome gets it done and posts a patch for 3.x. If that doesn't happen, then I would say mid to end of summer.

tregismoreira’s picture

Great, @fmizzell. If you need help, tell us.

realityloop’s picture

Is it possible to get an update on the status of this please?

webadpro’s picture

I'm working on something and if everything goes well, by next week we should have something up for testing.

webadpro’s picture

FileSize
1.82 KB

Hi,

In order to get this revision up and running the following patch needs to get committed then install ECK Revision.

ECK Revison
https://www.drupal.org/project/eck_revision

Feel free to test and report issues.

rooby’s picture

re #13, does that mean you need that patch plus that module or just the patch?

Shouldn't it all be in this module?

webadpro’s picture

It needs that patch plus the module.

rooby’s picture

Seems like this should all be in the same module, would it be feasible to make a patch for this module based on your module?

The maintainer says they will accept a patch for the 3.x branch.

Aside from Drupal core entities (like users, which require a secondary module to add revisioning), all entity related modules I know of have revision support in the main module.
It's pretty core functionality.

  • fmizzell committed 1ade28b on 7.x-2.x
    Issue #1186552 Refactoring some of the new behavior hooks, and moving a...
  • fmizzell committed b76b739 on 7.x-2.x authored by webadpro
    Issue #1186552 Adding a few new behavior hooks to support a revision...
fmizzell’s picture

Status: Active » Fixed
webadpro’s picture

--

webadpro’s picture

eck_revision has been patched & committed to match eck.

joelpittet’s picture

I got some nasty fatal error message on the latest dev commit from yesterday. I think it was related to this patch.
Fatal error: Cannot use object of type EntityType as array in contrib/ctools/includes/export.inc on line 1058

Just thought I'd drop a line, I'll investigate further later.

joelpittet’s picture

Sorry #21 completely unrelated, ignore me...

joelpittet’s picture

Title: Support Revisions in ECK » [Regression] Support Revisions in ECK
Status: Fixed » Needs work
FileSize
189.63 KB

Inside eck_schema_alter(&$schema) it seems to be now merging on the EntityType object.

So cancel that ignore me in #22.

Though this may be a new bug, I only saw it after this patch. Seems to be the fault of
eck_property_behavior_invoke_plugin_alter() or maybe more likely eck_schema_alter().

From what I gather, $entity_type_shema maybe should be merging the schema result?

if ($entity_type_schema) {
        $schema = array_merge($schema, $entity_type_schema);
      }

to something like

    if (isset($entity_type_schema['schema'])) {
        $schema = array_merge($schema, $entity_type_schema['schema']);
      }

OR eck_property_behavior_invoke_plugin_alter() is not the right function for the job of letting the properties modify the schema?

Feel free to boot me to a new issue...

joelpittet’s picture

Status: Needs work » Needs review
FileSize
563 bytes

Here is that as a patch, it fixes the problem, though it may be best to get a maintainer review.

  • fmizzell committed e23cdd5 on 7.x-2.x authored by joelpittet
    Issue #1186552 Fixing a mistake in the logic of the new schema behavior-...
fmizzell’s picture

Title: [Regression] Support Revisions in ECK » Support Revisions in ECK
Status: Needs review » Fixed

@joelpittet Thank you, I committed a slightly modified version of your code.

For eck_revision to work now, the patch from issue #2300901: ECK's schema alter behavior hook has been modified is required.

webadpro’s picture

#2300901: ECK's schema alter behavior hook has been modified patch has been commited.

ECK_revision should be working just fine with the latest ECK version.

joelpittet’s picture

FileSize
176.78 KB

Thanks that's saves the fatal and is a bit better than what I had!

I noticed you put in array_key_exists, and I just learned about that a few months back but I think you have it backwards. The article that was referenced to me last time I brought it up was that array_key_exists is needed (I always used on isset() in most of my usecases)

http://www.zomeoff.com/php-fast-way-to-determine-a-key-elements-existanc...

So because isset() calls are ~2.5 times faster you should lead with isset() and use PHP's conditional shortcuts to avoid the extra check for NULL values that array_key_exists catches.

And just one little nitpicky tip on coding standards, depending on your editor of choice, you can turn on a column ruler at 80 characters to help spot when you should break a comment line. And also most editors have a nice little trim trailing whitespace on save, which is nice to not have to think about those things as much.

webadpro’s picture

Simply an update regarding ECK Revision. I've commited a new version that adds the revisions tab in order to manipulate the revisions of an entity.

Any testing would be great :)

fmizzell’s picture

Version: 7.x-2.x-dev » 7.x-2.0-rc4

@joelpittet All coding standards issues have been addressed. Thanks for pointing them out

joelpittet’s picture

@fmizzell I noticed, thank you:) I opened a new issue to tackle a bit more that I was mentioning in #28

#2309321: Optimize code by using empty or isset instead of array_key_exists

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rooby’s picture

Status: Closed (fixed) » Fixed

Since the question in #16 was not answered, am I right in assuming that this will remain in a separate module for the 2.x branch and then be within this module for the 3.x branch?

fmizzell’s picture

@rooby, at this point it is becoming a matter of man power. I would love to have all the tools together, but at the same time as I push to get the 3.x version out so I can start porting to D8, I am not looking forward to adding any more code that I need to maintain.

rooby’s picture

No worries, thanks for the clarification.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

lpalgarvio’s picture

Status: Closed (fixed) » Active

Hello

3.x branch is now unsupported.
#2495527: 3.x Roadmap: Unsupported, do NOT use

Can we get this functionality in ECK 2.x?
#2727433: Merge to ECK
eck_revision

DamienMcKenna’s picture

Version: 7.x-2.0-rc4 » 7.x-2.x-dev
hgoto’s picture

I understood that this issue was once closed since all the tasks were completed.

What are the remaining tasks in this thread? All the commits seems to be included in the version 2.x... Maybe, is to merge ECK Revision module expected to be handled in this thread?

dqd’s picture

Status: Active » Closed (duplicate)
Related issues: +#2788507: Add revision support

Last patch is 7 years ago. I recommend to mark this as duplicate to merge forces and efforts in the 8.x issue regarding revision support and go from there to discuss a possible backport if still required. #2788507: Add revision support