[Resolved] TypeError: Cannot read properties of undefined
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing a JavaScript error 'TypeError: Cannot read properties of undefined (reading 'indexOf')' while editing a custom field in their WordPress site using WPML and ACF. Solution: 1. We recommend confirming if the issue persists when only WPML plugins and ACF are active, with all other plugins and custom code disabled. 2. If the problem continues, provide a staging site for further investigation. Ensure to back up your site before making any changes. 3. Consider checking if the issue might be related to the browser, device, user, or location used for accessing the site. 4. Ensure that ACF field groups translation settings are set as not translatable to avoid issues. More details can be found here: Advanced Custom Fields field group should be set as not translatable.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
i have a problem while editing an custom filed TypeError: Cannot read properties of undefined (reading 'indexOf') at s (hidden link) at hidden link at Array.sort () at hidden link at hidden link at Object.Wt [as useMemo] (hidden link) at e.useMemo (hidden link) at Jd (hidden link) at ht (hidden link) at vr (hidden link)
Symptoms:
Questions:
i have a problem while editing an custom filed TypeError: Cannot read properties of undefined (reading 'indexOf') at s (hidden link) at hidden link at Array.sort () at hidden link at hidden link at Object.Wt [as useMemo] (hidden link) at e.useMemo (hidden link) at Jd (hidden link) at ht (hidden link) at vr (hidden link)
While one of my teammates takes care of your ticket, I will provide you with the first debugging steps.
Are you using the latest version of WPML (4.6.14), and have all related plugins been updated on your installation?
Additionally, please upload any relevant screenshots or links that can help illustrate the problem. I want to ensure that we fully understand the issue so we can provide the best possible solution.
Since the issue happens also when creating a page in Arabic, please try next: Disable WPML plugins, and from WP settings change the language to Arabic. Create a new page and check fi the issue still happens.
It could be the issue is not related to WPML; but to AR language and ACF.
Hello , i tried to do that but its still same problem please check the video
hidden link
i believe the problem is related with the configuration between ACF and WPML because other ACF post types doesn't have this problem , for example i have other ACF post type called Majors is working fine , but when its come to universities there's something wrong with WPML configuration
thanks for getting back and sharing the video, as I might have a clue why it happens.
The error that you got that happens sometimes, is probably related to your server and resources of hosting. I advise you to check it out / logs and increase it since a similar issue was reported and resolved in that way.
I have watched the video, but looked to me like related error.
1) Can you confirm issue still happens when using only WPML plugins and ACF, all other plugins and custom code disabled.
2) If the issue still happens after step 1, please if possible provide a staging site, so I can disable plugins, check error logs and etc to see what is wrong.
Please make sure to create a backup, before doing any actions, just in case.
If you need further help with this, please open a new ticket / chat and we will be glad to advise further.
Regards,
Drazen
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.