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.
This is a follow up issue to #1358682: Add Language property to ECK. We should keep this open as an issue.
Comments
Comment #1
olafkarsten CreditAttribution: olafkarsten commentedMaybe we have to rethink the just commited language behavior plugin, as in entity_translation some important changes are close to be commited. Look at #1280546: Introduce a language selection widget for every entity and #1282018: Improve UX of language-aware entity forms to get an idea.
We should let ET do work with bundle settings here, I guess. So the behavior plugin should only enable ET integration for an ECK Entity type or not. All the hard work we leave for ET. ;)
Comment #2
cspitzlayIs there any update on this?
Would it mean an incompatible change letting entity translation do the heavy lifting?
Comment #3
grndlvl CreditAttribution: grndlvl commentedRequires entity_translation patch from comment 1 #1866076: Add support for non-entity load tokens when declaring translations
Here is a stab at it.
Comment #4
grndlvl CreditAttribution: grndlvl commentedComment #5
grndlvl CreditAttribution: grndlvl commentedWhoops looks like I forgot the translation handler.
Here is another.
Comment #6
cspitzlayThanks for your work on this!
I tried your patch and it allowed me to translate my eck entity
and the translated field values are shown alright.
I haven't found a way to get the field *labels* translated, though.
Comment #7
fjen CreditAttribution: fjen commentedYou can use the field translation module in i18n to translate the labels: http://drupal.org/project/i18n
Comment #8
fjen CreditAttribution: fjen commentedThe patch does not work for me. I'm getting:
Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1431 of /Library/WebServer/Documents/test/processing_org/sites/all/modules/entity_translation/includes/translation.handler.inc).
when trying to view a bundle of an entity that has been set to be translatable ( /entity_name/bundle_name/id ).
I have
Drupal 7.18
entity_translation 7.x-1.0-beta2+7-dev
eck 7.x-2.0-rc1+6-dev
I found that during that call a false bundle instance is passed around, not sure where that comes from ... it arrives in EntityTranslationECKHandler as $entity with an id NULL and type set to the actual id.
Comment #9
fjen CreditAttribution: fjen commentedIn reply to myself (#8), i filed a bug at entity_translation about this: http://drupal.org/node/1877032
Comment #10
grndlvl CreditAttribution: grndlvl commentedStill requires #1866076: Add support for non-entity load tokens when declaring translations
Adding support to replace title with translatable field as well.
@fjen try ECK 7.x-2.x-dev
Comment #11
yang_yi_cn CreditAttribution: yang_yi_cn commentedthe previous patch in #10 missed the file eck/includes/translation.handler.eck.inc and will cause some fatal error about a class not found.
I rolled another one to add that part back (find that part from #5).
Still requires #1866076: Add support for non-entity load tokens when declaring translations
Comment #12
klonosignore me
Comment #13
garphy CreditAttribution: garphy commentedApart from the issue discussed here, which focus on field-level translation, I've started to work on Entity-level translation (Translation Set API from i18_translation).
Code is shared in this sandbox : http://drupal.org/sandbox/garphy/1966680
Comment #14
mErilainen CreditAttribution: mErilainen commentedThe last patch doesn't seem to apply. Has there been any progress on this or any workarounds? This makes ECK quite unusable.
Comment #15
grndlvl CreditAttribution: grndlvl commentedRe-roll against 7.x-2.x
still requires #1866076: Add support for non-entity load tokens when declaring translations
Comment #16
plachI think you can use just
entity_language()
here.Comment #17
miiimoooI've applied both patches cleanly (to eck and et) and enabled translation for my field of my eck entity bundle but there is no translate tab anywhere. Am I missing a trick?
Comment #18
grndlvl CreditAttribution: grndlvl commentedDid you enable another language?
Check if the translation is on nodes.
Permissions?
Comment #19
capnut CreditAttribution: capnut commentedIf anyone else had problems with patching:
seems like eck-entity_translation_integration-1798646-12.patch does not apply succesfully against eck-7.x-2.x-dev - failing to add
to eck.info
Adding the string manually makes entity translation work, although there is an error/warning appearing:
Strict warning: Only variables should be passed by reference in entity_translation_get_handler() (line 1777 of entity_translation/entity_translation.module)
- but it seems like an issue with patch for entity_translation.Comment #20
grndlvl CreditAttribution: grndlvl commentedYeah it's a little odd that the packing code would be in the way. On another note it still applies to 7.x-2.x HEAD.
Also @plach re:: entity_language() It has been a while since I have rolled this patch, but when patching this entity_language was not being set by entity_translation() soon enough, maybe it works now though? I don't recall the exact reason why this was not the case.
Comment #21
cimo75 CreditAttribution: cimo75 commentedHi
any news about adding translation to custom entities? before using the --dev version I had the language dropdown selection working at least, but no way to add transaltions ot the same entity. Now i tried the --dev version and the translations settings are gone in my bundles.
Is translation possible at this point? ECK looks very promising.
tx
Simone
Comment #22
FooZee CreditAttribution: FooZee commentedHi
any updates here, is this still working/applicable ? any intention to support any sort of translation before the 3.x branch is released ? :)
Thanks
Comment #23
cyborg_572 CreditAttribution: cyborg_572 commentedThis is a re-roll of the patch in #15 that applies to both 7.x-2.x and 7.x-2.0-rc2
It also fixes a bug(?) where title fields appear in the "Manage Fields" section for entity types that don't have titles.
Comment #24
klonos...thanx
Comment #25
Ludo.RHi,
Can someone explain what should happen when entity translation is enabled for ECK entities?
I've succesfully applied following patches but I can't see anything new :
I've enabled translation at field level for my entity type, cleared cache. But I can't see any "Translate" tab when viewing my entity?
Thanks!
Comment #26
lpalgarvio CreditAttribution: lpalgarvio commentedsee these issues on Field Collections
#1344672: Field Collection: Field translation (entity_translation) support. - entity translation
#1316162: Support content translation and host entity cloning - content translation
the ideas being used there might be useful for ECK development
Comment #27
axe312 CreditAttribution: axe312 commentedHi,
I tested the patch via simplytest.me. The patch is still applying to the current dev, but I get no translation tab, also. I just can select the entity language at the edit form.
Any ongoing development? I might help, but where to start?
Thanks for the patches, its going into the right direction!
Edit: Tested the patch in combination with entity inline form for my particular use case. Unfortunately, its not working here, also. (Its still just displaying the non-translated fields. The translateable fields have "NULL" as value)
Comment #28
marcusx CreditAttribution: marcusx commentedPatch works for me.
You must configure / enable the entities to be translatable on admin/config/regional/entity_translation to see anything.
Comment #29
marcusx CreditAttribution: marcusx commentedHide old files.
Comment #30
PedroMiguel CreditAttribution: PedroMiguel commentedPatch didnt apply to the latest dev:
Comment #31
garphy CreditAttribution: garphy commentedRe-rolled the patch.
Comment #32
joelpittetJust a quick review with some coding standard nitpicks and one item that needs attention.
@see http://drupal.org/coding-standards
Shouldn't this be LANGUAGE_NONE? And you can likely put this as the variable initializer above line 400 before the condition to initialize and save the else lines.
Extra line.
Period at the end of this sentence.
80 char limit.
Comment #33
garphy CreditAttribution: garphy commentedRerolled once again and fixed some of the problems mentioned in #32.
Comment #34
fmizzell CreditAttribution: fmizzell commented@garphy multilingual and translation are planned as full features for 7.x-3.x, if you roll the patch against 3.x I will go ahead and merge it, and we can have architectural and approach discussions afterwards since we don't even have an alpha of 3.x yet, but that should keep you from having to keep on rolling the patch. Thoughts?
Comment #35
joelpittetI'd like to check up on the "dummy menu items note". Could you point me where it complains without them?
There is some more coding standards notes. Mostly double \n and lack of \n at EOF. Thanks for the re-roll @garphy!
Also want to keep this issue near the top of the queue:D
This new line isn't need either.
Is this really needed? Where does it complain, I'd like to test this out.
Only needs one space.
No newline at end of file.
Same with here.
https://drupal.org/coding-standards#indenting
Comment #36
garphy CreditAttribution: garphy commented@joelpittet: I don't know if the dummy items are really needed. Let's check as it effectively sounds like a hack.
@fmizzell: I didn't yet checked out the 3.x branch so I'm not aware of the differences w/ 2.x. It's sounds reasonnable to commit this in 3.x as it seems quite stable on my 2.x setup since a while now.
(but i'll still need a patched 2.x setup until 3.x can safely take over ;)
Comment #37
fmizzell CreditAttribution: fmizzell commented@joelpittet
Some of the new cs issue might have been introduced by me, let's focus on the functionality, and then we can clean up all coding standard issues in one shot once it is merged. If you have objections to this, let me know.Nevermind, since this is going to be focused toward being a patch for 2.x, let's keep the patch clean :)Comment #38
fmizzell CreditAttribution: fmizzell commented@garphy, very well, 2.x is the version most people will be using for at least a couple more months, so I will take on the task of moving things to 3.x.
Comment #39
garphy CreditAttribution: garphy commentedI'll be glad to help out on the 3.x patch. Let's cross reference the 3.x issue when it's open.
Comment #40
grndlvl CreditAttribution: grndlvl commentedOK I have addressed the reset of the nit picking coding standards from 32 & 35.
I also tested to re-affirm the validity of the dummy items. I suppose alternatively we could possibly remove this additional validation that entity_translation is attempting? Otherwise we still need them.
Incurred notices:
From: _entity_translation_validate_path_schemes(&$schemes, $entity_type_label, $items = FALSE, $warnings = FALSE)
Code reference: http://cgit.drupalcode.org/entity_translation/tree/entity_translation.mo...
Thanks,
Jonathan
Comment #41
grndlvl CreditAttribution: grndlvl commentedForgot the new line at the end of the info file.
Comment #42
joelpittet@fmizzell I'm all for not fixing all the coding standards for the module in this issue and should open up a followup for that. BUT it would be easier to review if the new code or changed code doesn't introduce new coding standards mistakes because it's hard to see the forest for the trees(...If all you see is the trees;).
Comment #43
joelpittetOh and @grndlvl nice work! grndlvl++ Looks like you got them all:)
And thank you for re-affirming and the error output you get when the dummy items aren't present. How about opening an issue in their queue and just put an
@todo Remove these dummy items once issue https://drupal.org/node/XXXXXXX is resolved.
?That way they are aware of the issue and we can move forward with this patch?
Comment #44
grndlvl CreditAttribution: grndlvl commented* Created a ticket over at #2273189: Account for entities that may not create callbacks at "entity/ID" or "entity/ID/edit".
* Added todo
Comment #45
BarisW CreditAttribution: BarisW commentedHere's a re-roll
Comment #46
BarisW CreditAttribution: BarisW commentedNow with patch
Comment #47
BarisW CreditAttribution: BarisW commentedAnd now without the packaging info. The reason that the patch is so much larger is because my editor removes all trailing spaces according to the Drupal Coding Standards.
Comment #48
cyborg_572 CreditAttribution: cyborg_572 commentedIt's generally a good idea to do code style changes separate from functionality changes. It makes it easier to tell what the patch is doing, easier to review the changes, and reduces the chances that the patch will need to be re-rolled.
The easiest way to get rid of those line ending changes would probably be to generate the patch again using
git diff --ignore-space-at-eol
instead of justgit diff
.Comment #49
marcusx CreditAttribution: marcusx commentedI could apply the patch only on the 3.x version. Was it not meant in #39 that this is a patch for 2.x and 3.x gets a separate issue? Did I miss something?
Using the patch with 3.x results in
if I try to create an entity.
Comment #50
marcusx CreditAttribution: marcusx commentedIt seems that
Is missing in the latest 2 patches.
Comment #51
grndlvl CreditAttribution: grndlvl commentedTry 44 against 7.x-2.x HEAD.
Comment #52
marcusx CreditAttribution: marcusx commentedOK, I can confirm that #44 is at the moment the patch that applies against 2.x and hast all the translation handler stuff.
Comment #53
garphy CreditAttribution: garphy commentedCommit 6b2be8f39e976260df1a30a8dda73f6ede3a5c6a made #44 non applicable on latest 2.x.
I'm rerolling #44 to accomodate coding standards enhancements.
Comment #54
garphy CreditAttribution: garphy commentedComment #55
garphy CreditAttribution: garphy commentedComment #56
Monsjakob CreditAttribution: Monsjakob commentedGreat work, I really need this to work :)
I think all is working great except like axe312 I do not get a translation tab on my entities. I did configure / enable the entities to be translatable on admin/config/regional/entity_translation.
Any ideas what I am doing wrong?
Jens
Comment #57
axe312 CreditAttribution: axe312 commentedHey there,
we use this patch to create translatable entities build with eck referenced within an node page. For several times we ran into problems setting this environment up. Here is a short description how to to that:
Patch it:
Configure it:
A lot of stuff to do, but it is working for us in several projects :)
Greetings from Berlin, Germany
Ben
Comment #58
pedrospPatch #55 not suitable for last dev, however I managed to "manually" applied those changes, and it works ok, together with eck_revisions btw.
The following change present in #55 is already present in last dev.
Comment #59
mkolar CreditAttribution: mkolar commentedHi, I edited patch #55 to fit 7.x-2.x branch but I can't get it work...
Drupal version: 7.35-dev
ECK version: 7.x-2.0-rc4
with https://www.drupal.org/files/issues/eck-entity_translation_integration-1...
Entity Translation version: 7.x-1.0-beta3
with https://www.drupal.org/files/entity_translation-add_support_no_load_toke...
I can see Translate tab in my entity view but in translate form there is no data filled (from original lang and it should be) and after save its not saved without any message and I can see errors "Strict warning: Only variables should be passed by reference in entity_translation_get_handler() (line 1779 of /var/www/sitename/sites/all/modules/contrib/entity_translation/entity_translation.module)."
Comment #60
pedrospThe last 59 patch failed against last dev because:
There is a new line 'view callback' not expected by the patch on
And translation.handler.eck.inc should be located inside the includes folder, but it is created on the root module.
Comment #61
pedrospI finally got it working today with this:
1) Last Dev 7.x-2.0-rc6+6-dev
2) Patched from 55 (no 59) applied manually to understand what's going on (and because neither 55 or 59 didn't work out-of-the-box):
- Some code is already present in dev
- When patching eck.entity_type.inc > function eck__entity_type__info($entity_type),
insert the code
'translation' => array( ....
before the'view callback'
.- make sure that the file "translation.handler.eck.inc" is created inside the includes folder
3) As stated in #57 Enable the language property for your eck entity
Comment #62
mihai_brb CreditAttribution: mihai_brb commented@pedrosp can you please create a clean patch against the latest dev so others can test this easy ? Thanks.
Comment #63
pedrospThere you are.
Be kind, this is my first patch, git powered a-la-drupal, ever ;)
BTW, I wonder if there is a way to make mandatory through code, the language property on the ECK when this code is applied.
Comment #64
marabak CreditAttribution: marabak commentedi can't apply #63 against 7.x-2.x-dev with drush make.
when applying it manually the translation.handler.eck.inc file is created in the root directory
Comment #65
marabak CreditAttribution: marabak commentedComment #66
marabak CreditAttribution: marabak commentedComment #67
garphy CreditAttribution: garphy commentedRemoved trailing "garbage" from the .info file (previous patch maybe made against a .tar.gz -dev release ?)
Replaces patch #66 which doesn't apply against a git checkout.
Comment #68
colanExtra whitespace.
Missing comments explaining what the code is doing.
Missing comments.
Comment #69
peterpoe CreditAttribution: peterpoe commentedUpdated patch addressing code review in #68.
Comment #70
rogerpfaffAfter applying the patch to the latest dev-version pulled by drush and applying the patch I get Fatal error: Class 'EntityType' not found in /var/www/sites/all/modules/contrib/eck/eck.module on line 301.
I'm also using the latest Entity Translation Dev from drush.
Comment #71
rogerpfaffRe-tested this with a new installation.
eck 7.x-2.0-rc6+7-dev
ET 7.x-1.0-beta4+8-dev
Patch #69 eck-entity_translation_integration-1798646-69.patch
This is the combination that works.
Comment #72
joelstein CreditAttribution: joelstein commentedNow that #1824772-21: Add entity properties to "Manage Fields" form has been committed, the title field will be added to the Manage Fields UI (if enabled per-bundle at admin/structure/entity-type/ENTITY_TYPE/BUNDLE/edit).
Re-rolled without eck_field_extra_fields().
Comment #74
fmizzell CreditAttribution: fmizzell commentedComment #76
fox_01 CreditAttribution: fox_01 commentedLatest dev from eck has the patch already included but i cant see a translation tab. i enabled the entity_translation for my eck type and enabled translation for the bundle. i see the language field but no translation tab. any suggestions?
EDIT: It was a "Path error" when i go to /contents//edit i see the translation tab but admin/structure/entity-type//contents/ the tab is not available.
Comment #77
joelpittetThis causes issues if example panels is defining a path that matches the eck dummy paths.
Sorry re-opening this because those dummy paths cause more problems then they sole I believe. Maybe a follow-up is warranted?
Comment #78
joelpittetHere's a partial revert.
Comment #79
joelpittetActual remove instead of comment out.
Comment #80
Yuri CreditAttribution: Yuri commentedI get patch#72 cannot be applied
Comment #81
joelpittet@Yuri #72 has been committed.
I'm trying to revert this because it breaks paths that match the entity name.
Comment #82
grndlvl CreditAttribution: grndlvl at GollyGood Software for Zivtech commented@joelpittet out of curiosity, how is it breaking it? I haven't had a chance to test it in a while, but I may during Drupalcon.
Comment #83
vladimir.krupin CreditAttribution: vladimir.krupin at DrupalJedi commentedHello.
Now I have a problem with view enitity with bundle. After enable translation I have an error
Missing bundle property on entity of type component. in entity_extract_ids()
Menu item have no load callback. /entity/bundle/%/translate while accessing this url I have fatal error because base path, translate path, path wildcard were not correct, we should use wildcard here %eckentity.
I have attached the patch. Please check it. Thanks.
Comment #84
joelpittet@grndlvl sorry forgot to answer. I had a panels path that matched the entity name. (eck entity named 'away', panels page path called 'away/%')
The new eck path was taking precident and setting access to FALSE preventing anybody from going to that path.
Comment #85
joelpittet#83 looks good too, but also need my patch in #79 for what I've described in #84
Comment #86
legolasboSetting to needs work because of #85
Comment #87
joelpittet@vladimir.krupin Could you combine them?
Comment #88
joelpittetHere's both combined #79 + #83, @vladimir.krupin might be busy.
Comment #89
DamienMcKennaSo, I'm working on some tests. So far, using the latest Entity Translation dev snapshot it seems like ECK entities are translatable out of the box?
Comment #90
DamienMcKennaNot sure why it is saying "no tests found" when that's all the patch contains?
Comment #91
grndlvl CreditAttribution: grndlvl at GollyGood Software for Zivtech commented@DamienMcKenna
That would be because the integration was already added into dev, however, there is a small remaining issue as mentioned in #77, #83, and #84.
It would probably be beneficial for testing these instances as well and rolling #88 into the patch to see if it was resolved.
Comment #92
DamienMcKennaTests to show that the correct embedded entity is loaded when it's attached to an untranslated field on a translated node; all translations handled using Entity Translation.
Comment #93
DamienMcKennaSo are the other issues related to path precedence and partial matches? Could someone please expand the tests to show how the paths would fail?
Comment #94
DamienMcKennaSome @todos for later, and an improved description for the translation tests.
Comment #95
DamienMcKennaI've moved the tests into #2889325: Add simpletests for D7 so that this can focus on just these edge cases. We might consider moving the edge cases to a separate issue and putting this one back to "fixed".
Comment #96
DamienMcKennaComment #97
DamienMcKennaSkipping my patches from #89, #92 and #94, I've tested out #88 on a site where the local tabs weren't showing and it fixes that problem.
That said, I now get these errors, as reported in #40:
Putting the code back in from eck.bunde.inc makes these go away, i.e. just sticking with #83 seems to solve the problem. Correct me if I'm wrong, but this is because of #2273189: Account for entities that may not create callbacks at "entity/ID" or "entity/ID/edit", right?
Comment #98
mrchristophy CreditAttribution: mrchristophy commentedI'm using the current dev version and tried applying all the latest patches but I still don't see any translate tab - what could I be missing?
Comment #99
sassafrass CreditAttribution: sassafrass as a volunteer commentedI also applied patch #88 to the latest released dev version. Although the patch applied cleanly, I did not see the translate tab either. Then I tried applying patch #88 to the latest dev version from the git repository and got the following:
Comment #100
joelpittetReroll of #88
Comment #101
pifagorComment #103
pifagorComment #104
ciss CreditAttribution: ciss as a volunteer commented@pifagor Why was this committed even though the last status was "Needs review"? Could you provide some background?
Comment #105
DamienMcKenna@cis: I think pifagor just forgot to update the status to "fixed", no mystery.
Comment #106
ciss CreditAttribution: ciss as a volunteer commented@DamienMcKenna I was referring to the status prior to the commit (which was Needs review). Your comment in #97 also seems to imply that the patch in #88 (which is the basis for the latest reroll in #100) still has issues. Hence me asking.
Comment #107
pifagorHello @ciss
Patch #100 worked for me. I just did forget to post status "Reviewed & tested by the community" and moved the changes. If there is any problem, please describe them, and I will either turn revert the changes, or we will fix the problem.
Comment #108
ciss CreditAttribution: ciss as a volunteer commented@pifagor Thanks, I just wanted to be sure that the patch wasn't committed prematurely. I also just noticed that @DamienMcKenna reran the tests in #2889325: Add simpletests for D7 successfully. That's all the peace of mind I need. :)
Comment #109
pifagorThank you for your concern. If you will have any problems write me.
Comment #110
joelpittetThank you for committing that, I've been using that patch to resolve the menu routing being overridden for a while!
Comment #112
joelpittetDid this commit 4c4cd91 get reverted in -dev? I'm seeing this code again and referencing #2273189: Account for entities that may not create callbacks at "entity/ID" or "entity/ID/edit"