This may seem like a silly question, but... why is workflow_node_current_state() not called workflow_entity_current_state() or workflow_get_current_state()?

With the 2.x branch, it's no longer specific just to nodes. And this function exists in workflow.module rather than workflownode.module, so the use of "node" in the name seems odd.

Comments

Bastlynn’s picture

That function is pretty old in the development history, but we also don't want to unexpectedly break things for a module that's dependent on workflow, so the footprint is the same for now. Eventually it should start to be phased out but we've just had bigger things on the list to deal with than the name of the function.

GuyPaddock’s picture

I get that, but why not mark it deprecated, add the entity version, and then just make the node version call the entity version?

johnv’s picture

Status: Active » Closed (works as designed)

Already a lot of functions have been marked as such. However, this function is used in third party modules as well. And it is a very popular module for custom modules. There were a lot of feature requests for Field-like features.
i did not want to break to much of updates from 1.2 to 2.x.

Rest asured, it will be gone in d8.x

GuyPaddock’s picture

Category: Support request » Feature request
Status: Closed (works as designed) » Active

My point was just, declare a new function called workflow_entity_current_state() that just calls the existing function (so it's clear it works with ENTITIES as well), or move code from workflow_node_current_state() into workflow_entity_current_state() and then make workflow_node_current_state() call workflow_entity_current_state() and mark it deprecated.

Citing D8 is not a useful answer... D7 is going to be around for quite a while and will still be the more popular release until at least 2017. You can't just say "Ok, well, we're not maintaining the 7.x release so I guess you'll just have to rebuild all your sites on D8".

D8 also isn't released yet... so, D7 is still the main release.

johnv’s picture

Patches are welcome. :-)

johnv’s picture

Status: Active » Closed (won't fix)

You are right, but adding an extra layer of code just for semantics....
Please see the new and shiny approach in D8.