Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
One of the biggest problems of current multilingual systems in drupal is that there's no way to do polls the right way - separate languages are kept as separate nodes, and so votes are kept separate in each language, defeating the point of a multilingual poll.
Is there a strategy / plan to fix this?
Comment | File | Size | Author |
---|---|---|---|
#19 | interdiff-multilingual_poll_choices-132339-16-19.txt | 1.3 KB | edurenye |
#19 | multilingual_poll_choices-132339-19.patch | 20.2 KB | edurenye |
| |||
#16 | interdiff-multilingual_poll_choices-132339-14-16.txt | 12.54 KB | edurenye |
#16 | multilingual_poll_choices-132339-16.patch | 20.37 KB | edurenye |
| |||
#14 | multilingual_poll_choices-132339-14.patch | 13.28 KB | edurenye |
|
Comments
Comment #1
Gábor HojtsyAs I have expressed my opinion to Roberto at his blocks issue:
Sharing data between nodes would be the ultimate solution here. Life would be a lot easier for us if everything would be a standalone CCK field (although it would be prohibited by performance requirements probably).
Comment #2
Gábor HojtsyMoving to Drupal 7 queue. We don't have a separate code repository now, so no reason to have this separated as if someone is working on it.
Comment #3
Jose Reyero CreditAttribution: Jose Reyero commentedComment #4
Jose Reyero CreditAttribution: Jose Reyero commentedThis should wait for the outcome of: #367595: Translatable fields, also changing priority temporarily for i18n sprint.
Comment #5
nerkn CreditAttribution: nerkn commentedwith help of t function?
stupid and hard coded way but I couldnt get over any other way!
Comment #6
plachCleaning-up the "language system" issue queue as per http://cyrve.com/criticals.
Poll module should leverage the field API to fix this.
Comment #7
sunEffectively means better_poll_field module in core, replacing current poll module. Love, D8.
Comment #8
alexpottPoll is no longer in core
Comment #9
adammalonePoll is now an entity. My aim is to include support for the question and choice fields so each poll may be fully multilingual.
Comment #10
BerdirStarted testing this. Works pretty well with some fixes.
One issue is the choice ID, which is auto-incremented. It matches if you add translations of existing choices, but adding a new one to the original and then a translation will result in different ID's, don't know yet how to address that.
The problem that ID is trying to solve is that you can re-order choices.
Comment #12
BerdirComment #13
BerdirRerolled, fixed the test, still needs test.
Comment #14
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedAdded tests, so the interdiff is like a test only.
The only change is the addition of
content_translation_ui_skip = TRUE,
in PollChoice.Comment #15
BerdirThis means every test now enables those modules. I'd prefer to only do that in the test that needs them.
You need an admin user with that permission, which is why you did that. In tmgmt, we solved that problem by making the list of permissions a property on the base class and subclasses can override it ($this->adminPermissions)
there should be a poll specific permission too I think.
Contains \Drupal..., not Definition of Drupal..
missing empty line after namespace.
why do we need this here? is there a specific bug we're testing against?
Use $this->poll, don't hardcode the id.
pick a different than the first choice, as we'll delete that, see below.
This seems to duplicate setUp() ? same question as there, why do we need this?
More hardcoded ID's. I think a helper method to get the choice based on the choice label similar to drupalgetNodeByTitle() would be useful so we don't need that. There's something like that already somewhere but it's afaik also based on the field delta.
So far so good, but we're missing the actually interesting things:
Edit the poll, remove the first option, add a new one. Go to the translation, translate the label there.
Go back to the poll, vote on the new option on the translation.
Make sure that the existing votes are correct and so is the new one. Check the actual specific votes, not just the total. See the delete test, I did that there too. Also make sure that the deleted choice is gone. All that in both languages.
Comment #16
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedYes, those tests where not testing anything, as testing the new things the translation of the choices was not working, now with the help of @Berdir it works. And it's tested well.
Also I found a bug and I opened an issue #2648802: Deleting a choice should delete the votes over it in the database
Also I'll open a issue in Core to find a solution to not need to create PollChoiceTranslationMetadataWrapper and PollChoiceTranslationHandler when you don't need the fields added by ContentTranslationHandler.
Comment #17
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedI opened the issue in Core #2648822: Make metadata optional in ContentTranslationHandler
Comment #18
Berdiris this needed? why not @inheritdoc?
Nitpick. $this->WebUserPermissions should be webUserPermissions.
Comment #19
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedDone.
Comment #21
BerdirAwesome. Committed.