-
Notifications
You must be signed in to change notification settings - Fork 110
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
ACF wysiwyg standard editor broken #1186
Comments
Good to have a test site:
I don't think the problem with the ACF Wysiswyg editor is new. It's mentioned in #985 and #1044. |
Thanks for the solution! Alas, I could not find this solution earlier and experienced difficulties for almost a year. Could you add a note to the instructions for this moment? If you need help, I can forward your messages to ACF PRO developers to solve this problem. |
It's probably due to the way the main ACF wysiwyg editor is initialized. We'd need to investigate first what happens in QTX. I wouldn't know where to put a note, this a standard field controlled by ACF, not created by QTX. You can see the open the issues on the ACF module searching by tag: https://github.com/qtranslate/qtranslate-xt/labels/plugin%3A%20ACF |
I had difficulties with my GitHub account and therefore I had only tested the Wysiwyg Editor (qTranslate-XT) field on the example page (degorov-ru). I also had to change the Wysiwyg Editors (qTranslate-XT) since ACF(-PRO) version 5.8.9. I was forced to take this dependency on running projects! As far as I can tell, the interoperability between the two plugins and their versions is not always guaranteed. The last working pair was QTX (3.11.4) with ACF-PRO (5.8.9). Here is the info in connection with Mozilla Firefox |
Hey folks, I'm one of the ACF devs and we're happy to help out on this one if we can. Just getting caught up on this one - it seems that the qtranslate-xt plugin includes a modified version of some ACF fields in order to make the values for those fields translatable, is that correct? If so, are there any hooks or similar we could provide that might make the integration a bit easier? I'm wondering if it might be possible to use ACF's hooks with existing fields rather than having to create new fields, but I'm sure it's not quite that simple in practice! |
Cool, thanks! 😎
Yes. You can find them here, it will surely talk to you:
This module comes from this plugin: https://github.com/funkjedi/acf-qtranslate. I contacted the original author several times but no answer. Since the former plugins (qTranslate and qTranslate-X) have been abandoned, the users base is here anyway (qTranslate-XT), so we can make evolutions in this ACF module. Ideally, hooks could allow to get rid of the derived classes so the standard ACF fields could be enough. That would surely be better for the users to avoid dealing with different sets of fields. But we can first see how to fix the Wysywig editor. |
In short, the derived fields are overriding:
For the wysiwyg editor it's more tricky as qTranslate-XT does some manipulation with the text editor (MCE) to allow editing and switching multiple languages before saving. |
Well, since this works in single-language mode, I belive that the dynamic language switching was implemented with faulty logic (JavaScript). Technically (isolated script) the language switching works with TinyMCE (ACF). |
Hello, When i press a Visual/Text tab there is an javascript error:
Thanks |
Major fix for the support of generic translatable ACF settings such as label, description and default value. Use undocumented `open_field_object`, works with ACF5.12.4 and ACF6. Delete obsolete ACF `append_field` JS hook. Anyway the hook for wysiwyg editor is currently broken (#1186).
It was very difficult to find but I understand the problem now by debugging the ACF code. The problem is due to a change of element The hooks have already been created for the textarea by the generic machinery of qTranslate. It requires some specific handling to fix the hooks and re-attach the wysiwyg textarea and the tinyMCE editor with special cases for visual/html modes. |
ACF is destroying HTML elements in their `initializeEditor` code. This results in QTX hooks pointing to detached HTML elements that no longer exist in the document, breaking the LSB switch. See: AdvancedCustomFields/acf#767 Change the main i18n configuration to filter out any `acf-editor` so that the hooks are not created too soon. Delaye them to the `wysiwyg_tinymce_settings` filter which also sets the mceInit callback for the visual mode.
The problem with the elements destroyed by ACF is reported in AdvancedCustomFields/acf#767. Finally I found a workaround for the standard ACF wysiwyg editor, by delaying the creation of the hooks - yay! |
Everything worked during my tests! |
Good! I had a doubt leaving the default |
@mattgrshaw thanks for your message again. Very good remarks, I agree completely.
Imo we should stick to method 1 and deprecate 2. Current fields
If we can handle the missing ones in 1 -which I think is possible- we can drop method 2. It will require more JS code but there's some good potential, even to support new fields, and I believe it's more sustainable on the long run. |
Released in 3.13.0. |
Follow-up of #1186 and #1300. Since the standard ACF fields are better supported, those should be preferred over the qTranslate extended fields. In particular: text, textarea, wysiwyg are covered by the ACF standard fields, while others only exist as qTranslate extended fields. Deprecate softly these "duplicated" extended fields in their labels.
Follow-up of #1186 and #1300. Since the standard ACF fields are better supported, those should be preferred over the qTranslate extended fields. In particular: text, textarea, wysiwyg are covered by the ACF standard fields, while others only exist as qTranslate extended fields. Deprecate softly these "duplicated" extended fields in their labels.
Hello.
I use the qtranslate-xt translation plugin. It works fine with ACF version 5.8.9. With all versions newer, it has an error in the wysiwyg. The error is that when switching the language, the content does not change.
ACF developers answered me:
Video presentation of the problem:
https://disk.yandex.ru/d/yPUcrD7MQoCufw
https://disk.yandex.ru/i/xBPKo-dbdPkdWA
There are no errors in the console.
I launched a clean website, without third-party themes and plugins. Installed the latest version of QT 3.12 and ACF PRO 5.12.2. You can personally verify that it does not work.
Example site
https://degorov.ru/blank/wp-admin/
login: admin
pass: admin
BackUp
https://disk.yandex.ru/d/iA5NVQ4bKn-pFA - files
https://disk.yandex.ru/d/l9D1PFkk58hNSg - database
The text was updated successfully, but these errors were encountered: