Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate-button in flux:grid not working #1120

Closed
MarkusBausK opened this issue Apr 19, 2016 · 20 comments
Closed

translate-button in flux:grid not working #1120

MarkusBausK opened this issue Apr 19, 2016 · 20 comments

Comments

@MarkusBausK
Copy link

Hi,

in TYPO3 7.6.5 (I guess maybe the problem consisted in 7.6.4 too but I didn't test it) for me the "translate" button for contentelements that are situated in a flux grid element is not working. I tried to prepare some screenshots that are showing the problem. In the third step of the translation wizard is no content element shown. After starting step 4 it looks like something happens but it doesn't. It doesn't do anything till closing the wizard.

1-grid-backend
2-wizard-step-1
3-wizard-step-3

The translation wizard within the flux grid element (relations -> locale all) is working fine.

Thank you for a great job.

@mrk131324
Copy link

I can confirm the issue

@InvisibleKind
Copy link

Not sure if this is related, but sometimes tx_flux_parent column of localized CE contains funny numbers.
Example in my case: localized via "Translate" normal CE (text) without any flux grids and it got some random id in tx_flux_parent column (in my case it was an id of some "Header" CE from completely different page)
image
image
image

This behavior is not observed, when "Copy" is selected in localitzation window.

TYPO3 7.6.9
flux 7.4.0
fluidpages 3.6.0
fluidcontent 4.4.1

@dneuge
Copy link

dneuge commented Jul 18, 2016

The random numbers in tx_flux_parent will likely be fixed (maybe not retroactive) for #1125.

@andreaswolf
Copy link

I have fixed that bug for a client already. The problem comes from the Core not passing on the Flux parent element/column (how should it, as it does not know about these nested structures by default?)

The fix is to extend the Core translation wizard to pass on additional information and add that information in Flux. So we first need to get this fixed in the TYPO3 Core before we can fix it in Flux (or Flux needs to replace the broken parts from the core, but I don’t think this is viable).

@rorentz
Copy link

rorentz commented Jul 28, 2016

Localization is so important for us. I think everyone using flux would be happy, when there will be a fix, although the core needs to implement it. A content management system with no translation working is not really cool. :-(

@bauermar
Copy link

Dear @andreaswolf ,
could you publish the fix of these Bug?

@bauermar
Copy link

Ok I've fixed the problem in core and in flux. The problem ist that the child elements will not found because the colPos which is send to core API is 0 but should be ContentService::COLPOS_FLUXCONTENT. The second problem was that the new translated element will be created in default language grid element. Solution: In front of creating new translated element set tx_flux_parent of translated grid element uid.

Tested in Workspaces too and it works.

_BUGFIX___translate_button_in_flux_grid_columns_does_not_work.patch.zip

@NamelessCoder
Copy link
Member

@bauermar I appreciate the time you spent to debug this, but there is no chance we will ever make TYPO3 accept a change that specifically targets Flux (things like $fluxParent will be a no-go). I personally wouldn't want them to, either.

So this has to be solved another way: if there are patches required for the TYPO3 core, those need to be absolutely generic (so no mention of Flux there) and must make sense on their own (for example, adding signals that can modify the values you need to modify). I would also strongly advise against changing any method signatures.

Depending on how you frame those, they may insist you are adding a FEATURE, which would mean we can't support this until TYPO3v9 and can never support it on TYPO3v8 or LTS. We have to be extremely critical in this case!

@monosize
Copy link
Member

@NamelessCoder Maybe this one can be a solution

Idea

  • insert data-attributes to each flux:grid columns to indicate the correct column.
  • Override Localization.js as we have done with DragDrap.js
    • click on translate button
      • fetch new data-attributes and insert them into the ajax call.
      • in flux processCmdmap_preProcess or processCmdmap_postProcess we can do the translation

@NamelessCoder
Copy link
Member

@monosize +1 for thinking creatively ;)

Override Localization.js as we have done with DragDrap.js

I'm not a fan of overrides and the fewer we have, the better IMHO. But, if that's the only way... that's the only way.

fetch new data-attributes and insert them into the ajax call.

This might cause HMAC issues, I'm not exactly sure how the XHR is done. Aside from that, it sounds like a good way to achieve it. If we can change the colPos value then that should be enough, since there is already some handling of special colPos values with an offset of 18181 (real target stored in session). Of course we may need to fix our TceMain hook to restore that... I ripped most of it apart and put it back together to achieve the workspaces compatibility.

@monosize
Copy link
Member

@NamelessCoder I have build a PR. Can you take a look on that.

It was a little bit tricky. I had to have create own AjaxRoutes to handle flux:grid localizations.
It uses the localization method from the DataHandler ;-)

Tested in TYPO3v8.6. Should compatible to TYPO3v7.6.

@ghost
Copy link

ghost commented Oct 12, 2017

Hi!
did anybody test the patch in that case?

@svewap
Copy link

svewap commented Mar 7, 2018

Hi! I wrote a fix for this problem.
https://github.com/svewap/flux_translationfix
Maybe someone can extract the fixOrderInLocalization function and make a pull request?

@NamelessCoder
Copy link
Member

@svewap This looks great, looks like fewer overrides than I thought we'd have to do. It's a little hard to gauge from that extension how extensive the changes actually are (the PreviewView is guilty here, it has some nasty methods) - but if this works I think it's the solution we're looking for.

Would you mind preparing that as a pull request? You know much better than we do which exact parts that need to be imported - and you don't have to worry about the tests failing, I'll take care of that.

@svewap
Copy link

svewap commented Mar 7, 2018

@NamelessCoder Ok, I will try. Another person is maybe much faster than I :-D

@rorentz
Copy link

rorentz commented Apr 3, 2018

Great work @svewap !!! Is that fix already pulled into master ? Would be awesome!

@breakone
Copy link

breakone commented Apr 16, 2018

@svewap I tried your extension with the actual development version of FLUX and TYPO3 8.7.12 but I get an error after installing and clearing the caches and autoload manually:

Cannot access property WapplerSystems\FluxTranslationfix\Backend\TceMain::$cachesCleared 

Error thrown in file
.../typo3conf/ext/flux/Classes/Backend/TceMain.php in line 911.

When I change the access level modifier from private to protected in TceMain of FLUX, no CE appears in my FLUX grid-column (grid-column is empty). In the Relations-Tab of the grid-element, the CEs are visible.

After the translation of the grid-element with the "Copy" option, the childs are not copied.
bildschirmfoto 2018-04-16 um 12 37 54
bildschirmfoto 2018-04-16 um 12 38 26
bildschirmfoto 2018-04-16 um 12 38 37

@NamelessCoder
Copy link
Member

Solved as part of #1563, will be included in release 9.0. Please see the PR for more details, among other things about how to use the migration script.

This particular button is now removed - you should use the page-level translation button, or create a translation of each element by drag-and-drop-and-copy, or using the language field to make a new translation.

@typoworx-de
Copy link

I'm still missing the "Translate Button" in my TYPO3 v9 & Flux 9.4.2 project. Any progress here?

@NamelessCoder
Copy link
Member

The button in question has been removed. Use the page-level translate button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests