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.

This topic contains 1 reply, has 2 voices.

Last updated by Shekhar Bhandari 6 months, 1 week ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
April 17, 2019 at 4:31 pm #3632931

neilT-5

I currently using Sage 9, ACF & WPML to build a website. It is hosted on pantheon & I am unable to provide access to you, but I wanted to share my findings.

I leverage ACF flexible content & repeaters heavily and have read the documentation on this and it is working 90% as expected.

I am receiving this error: Warning: Illegal offset type in isset or empty in /app/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 247.

The error is occurring in the function maybe_populate_cache( $element_id, $trid = false ).

The error is happening because $element_id is not always an integer but is an array when flexible content is iterated through. Link 247 is trying to use the array as a key which is the "Illegal offset type"

I see no workaround other than a return false if is_array but that doesn't accomplish the purpose of the "maybe_populate_cache" :p

If you have any advice on the matter, I would appreciate it, this may be something needed for a future update.

April 18, 2019 at 4:48 am #3636097

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you further on this issue.

Thank you for reporting the issue, before I report this to our developer's team I will need to replicate this so I would need a little help from your side, could you please provide a step to step guide to replicate the issue?

I understand that I should be creating ACF flexible content & repeaters, but just creating a simple flexible content & repeaters will show the issue? Where should I go to see the issue?

Further, to make this debug easy, I have created a sandbox site so could you please try to reproduce the issue there?

You can log in to the sandbox site using the following direct link, WPML plugins are already installed there: hidden link

This is a test site, so please use dummy content only.

Look forward to your reply.

Thanks

The topic ‘[Closed] PHP error due to unexpected variable type’ is closed to new replies.