0

I've noticed a lot of useful modules already created such as workflow, ACL, diff, and more. But these only seem to work with "content types". In our project, we have decided that "content types" aren't really well suited for what we need (Entities make more since). Very complex relationships must be modeled. Our entities are just that, entities, not content.

The problem is that when building an entity using hook_schema() and hook_entity_info(), these entities are not available to be used with different modules such as workflow. Is there any way to make them available? Or will we have to code similar workflow functionality by hand?

Workflow does exactly what we need, except only on content types. We need it to work on entities as well.

2 Answers 2

2

Especially in Drupal core, Nodes are still something like a Super-Entity with a number of features only supported by them, like revisions and the whole node_access thing. The entity.module tries to implement these features generically for all entities, I'm not sure if everything is covered yet.

Many modules only support nodes both due to these missing features (You can't configure ACL's or workflows if there is no way to limit access in the API, diffing is pointless without revisions) and historical reasons (all of your listed modules are ports initially Drupal 6 versions or even older and have been ported to Drupal 7). The whole concept of entities represents a major shift in Drupal and not all modules have made that step (yet).

I guess that's one of the reasons why e.g. Commerce uses Nodes as the default way to display products.

Work is ongoing in Drupal 8 to unify these features and provide them for all kinds of entities.

This is not really an answer to your question, more an explanation of the status quo. As Alex already mentioned, many of those modules are working on supporting entities or an entity-aware successor is being worked on, like http://drupal.org/project/state_machine.

2
  • +1 for introducing me to state machine...looks like that'll be a great module when it's ready
    – Clive
    Commented Feb 20, 2012 at 10:05
  • +1 because in my CS 3013 class (Computer Theory) ... we are learning about state machines (finite automata, etc...)
    – Jack
    Commented Feb 20, 2012 at 14:42
1

Unfortunately you are out of luck. Had the same problem with Flag module recently but lucked out and found the Mark module which is similar but for entities.

That said, it might not as hard as it seems to hack the workflow module to use Entities instead. Check out this issue, it seems the module is going this way but it might take a while to get it accomplished.

Disclaimer: I don't encourage hacking contrib modules but in certain cases you could create a branch for your project needs and preferrably submit back patches if you are succesfull!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.