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

qTranslateConfig.qtx is undefined #1006

Closed
smiddus opened this issue Apr 12, 2021 · 6 comments
Closed

qTranslateConfig.qtx is undefined #1006

smiddus opened this issue Apr 12, 2021 · 6 comments
Labels
bug Something isn't working, reproducible module: ACF Integration with ACF

Comments

@smiddus
Copy link

smiddus commented Apr 12, 2021

I am getting this js error on the Appearance/Menus page:

TypeError: can't access property "getActiveLanguage", qTranslateConfig.qtx is undefined 
mywebsite.local/app/plugins/qtranslate-xt-3.9.3/modules/acf/assets/common.js?ver=1616778581 line 62

This also blocks JS functionality such as expanding/collapsing under 'Add menu items', which means I can only add pages and not not for example custom links or a page switcher to my menus)

(Using qtranslate-xt 3.9.3, WP 5.6, ACF pro 5.9.5)

@herrvigg
Copy link
Collaborator

This could be the same issue as #988. Do you have the possibility to try with the current version on master? I have changed the way the ACF scripts are initialized. You may simply rename your current qtranslate-xt folder and unzip the last version from github for a test.

@herrvigg herrvigg added the module: ACF Integration with ACF label Apr 12, 2021
@smiddus
Copy link
Author

smiddus commented Apr 13, 2021

I tried the current version and it gives me different errors:
In dashboard (general):
ReferenceError: qTranslateConfig is not defined mywebsite.local/wp/wp-admin/ line 1578
In appearence/menus and other places:
TypeError: "repeaterFieldRemove" is read-only mywebsite.local/app/plugins/qtranslate-xt-3.10.0.dev.2/dist/modules/acf.js?ver=3.10.0.dev.2 line 1

@MK-RD
Copy link

MK-RD commented Apr 13, 2021

I was able to reproduce the behavior after changing the Internet connection throttling to Good 2G.

Throttling
https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/Throttling

@herrvigg
Copy link
Collaborator

@smiddus I've pushed a new patch to fix these 2 problems with JS. Could you please retry with this?

About repeaterFieldRemove I have two questions:

  • RepeaterField is not defined in acf.models though it was assumed to be the case in the past. Does anyone know if this has become obsolete?
  • there was a repeaterRemove function supposed to do some cleanup but I have no clue who is supposed to call that or when. It's coming from the legacy plugin but I don't think it was ever enabled, unless some script call "magically" a global function (which would be suprising).
    // Watch and remove content hooks when fields are removed
    // however ACF removes the elements from the DOM early so
    // we must hook into handler and perform updates there

@MK-RD not sure I understand the effect of throttling. How is that related to this issue? The only possibility I see would be to shuffle the asynchronous events but that was a problem in 3.9.3 not with the last changes in master (3.10.0.dev.x).

@herrvigg herrvigg added the bug Something isn't working, reproducible label Apr 13, 2021
@MK-RD
Copy link

MK-RD commented Apr 13, 2021

@herrvigg The changes should fix the problem!

By throttling the network speed, certain problems like this can possibly be checked against.

@smiddus
Copy link
Author

smiddus commented Apr 14, 2021

@smiddus I've pushed a new patch to fix these 2 problems with JS. Could you please retry with this?

It works. Haven't encountered any of the previous errors yet. Thanks!

qwave added a commit to qwave/qtranslate-xt that referenced this issue Apr 14, 2021
* [Yoast] Add front filters schema and breadcumbs (qtranslate#947)

* Add Bangla localization files (qtranslate#960)

* Fix async events with jQuery3 (qtranslate#946)

* Anticipate qtx init before TinyMCEinit (qtranslate#946)

* Fix deprecated tinymce.editors (qtranslate#946)

* Remove ready handler from common (qtranslate#946)

With jQuery3, ready and load can be fired asynchronously.
We cannot assume ready is fired before load.
Since qtx is also initialized in load, no need for ready anymore.

* Refactor TinyMCE hook functions in common (qtranslate#978)

* Add permalink info for pre-path mode (qtranslate#821)

* Release 3.9.3

* Fix async qtx loading in ACF (qtranslate#988)

* Bundle Javascript with Webpack and Babel (qtranslate#990)

See instructions in the Pull Request.
Reactivate plugin or save settings to update the new paths in admin config.

* Minor webpack cleanup

* Bundle ACF with Webpack (qtranslate#992)

Regroup all sources into a single bundle dist/modules/acf.js.
Move and rename source files.

* Split common.js and rename to main (qtranslate#994)

* Split common.js into multiple core source files
* Rename common.js to main.js (entry and output)
* Rename qtranslate-admin-common PHP to qtranslate-admin-main
* qTranslateX class definition no longer exposed

* Refactor js var with ES6 const and let (qtranslate#996)

* Fix text variable not defined (qtranslate#995)

* Refactor ACF js with ES6 const let (qtranslate#997)

* Refactor jQuery wrappers with local alias (qtranslate#998)

* Disambiguate and rename js variables (qtranslate#1001)

* Define js constants for URL mode

* Remove unused js functions

* Minor js cleanup

* Complete js vars renaming

* Update dist js

* Delete deprecated functions in 3.7.3

* Fix qtx and repeaterFieldRemove in ACF JS (qtranslate#1006)

* Fix undefined use_block_editor_for_post (qtranslate#1004)

Co-authored-by: HerrVigg <[email protected]>
Co-authored-by: Lenin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, reproducible module: ACF Integration with ACF
Projects
None yet
Development

No branches or pull requests

3 participants