Closed (fixed)
Project:
Workflow
Version:
7.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 May 2013 at 12:23 UTC
Updated:
21 Oct 2014 at 19:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nancydruThis is not an unreasonable request. I'll have to look at some way to handle it, if it can be done.
Comment #2
supermoos commentedCool, let me know when something is ready for testing and I'll give a thorough go for you.
Comment #3
johnvThis would be possible if Workflow were a 'true' Field API field, as proposed in #2019345: Create a 'Workflow Field' with Widget, Formatter, Fieldtype
Comment #4
johnvLet's focus on #2019345.
Comment #5
johnvThis should be working now using Workflow Field. Please re-open if there is a problem.
Comment #7
danielfdsilva commentedHi there,
I was trying to setup a workflow on a per entity translation basis and ran into all sorts of issues. For this I'm using field translation on the workflow field.
- I noticed that the workflow transition history always stores data with the language set to LANGUAGE_NONE. Why is this so? Doing so won't allow to show the transitions a given translation went through.
- When editing a node, the workflow field shows the value for the LANGUAGE_NONE and not for the actual language being edited. Some digging in the code led me to the workflow.module @line 838. Why is LANGUAGE_NONE hardcoded?
- The workflow field's table in the database contains data for all the languages available on the website instead of only the ones a node is translated to. This doesn't happen with other fields.
- When saving some translations, multiple entries are created in the workflow_node_history table and in some cases the field value for LANGUAGE_NONE is updated (The weirdest thing is that this doesn't happen for every language.)
I don't have the time nor the full knowledge needed to provide a patch assuming that this is an actual issue. However if you need more info let me know.
Comment #8
johnvWhen moving this module from version 1.2 to 2.x, the infrastructure was created to support all 'Field' functionalities.
The problem you describe is not deliberate, but it was not on my testing scope.
I'll try to see if this is a quick-fix, but I cannot promise anything.
Comment #9
danielfdsilva commentedHey all,
I actually needed this to be working for my project so I started digging and changed a few things. The patch I'm providing here is not, nor it is supposed to be, a solution but it could be a start for anyone who wants to fix it.
Use case:
I needed to be able to have a workflow per entity translation and I'm using field translation.
What's working:
- Only the language being edited is saved to the database.
- Workflow node history keeps track of history per language.
- When editing a node the correct value shows up in the field.
- The node/%node/workflow shows the information taking the current language into account.
Not working:
- The workflow views module does not take language into account, more specifically the subquery done by the relationship.
Unknown:
Since these were out of my use case they weren't even tested but could be working.
- Integration with other forms of multi-language
- When there are no translations.
- Scheduled transitions.
- Everything else.
If I can find the time I'll try to get back to it.
Comment #10
johnvThanks for that. Actually, I was working on it this week. I'll compare notes. 1 Thing springs to mind. You use global $language, whereas I use $entity->language.
Comment #11
danielfdsilva commentedHere's the exact same patch as #9 but for the dev version (7.x-2.x-dev).
Comment #13
johnvAbove fix adds the translation capabilities.
My main testing focus was to not break existing sites.
- Use of tokens is included.
- The Workflow History tab is still working for untranslated Workflows. For more complex situations like this one, I advice to use the corresponding Workflow 'Entity history' Views display, which is disabled upon installation.
- The list from #9 may still be valid.
Please test and report your findings.
Comment #15
johnvThis should be fixed. Please reopen if any problems arise within 2 weeks. Else, open a new issue, describing the problem.