Skip Navigation

[Resolved] Warning: preg_match() expects

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Waqar 1 year, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2443571
Bildschirmfoto 2022-08-23 um 18.05.59.png

I see an error in the backend, see pictures in Attachment:

Warning: preg_match() expects parameter 2 to be string, array given in /usr/www/users/sitewu/provita-deutschland.de/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/WpQueryExtension/AbstractRelationshipsExtension.php on line 541

#2443897

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Looks like there is a conflict with some code coming from a third-party plugin or theme.

Do I have your permission to download a clone/snapshot of your website? This will help in investigating this on a different server, without affecting the actual website.

regards,
Waqar

#2443899

Hi Waqar

Sure 🙂

Br

#2444685

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the permission and I've downloaded the website's clone.

I'm currently running some tests on this clone and will share the findings, as soon as this testing completes.

Thank you for your patience.

#2444735

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting.

During troubleshooting, I noticed that the warning message results from a conflict with the 'Subscriptions For WooCommerce' plugin. It is gone if that plugin is deactivated.

I've shared these findings with the concerned team for further review and will keep you updated with the progress through this ticket.

In the meantime, the nature of this warning is safe to ignore and shouldn't result in any missing/broken functionality. You can also turn off WordPress debugging to stop that warning message from appearing.

#2452049

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I've received a code snippet that can fix this error/warning until the fix is included in the future releases:


add_action( 'pre_get_posts', 'ts_workaround_subscriptions', 1 );
function ts_workaround_subscriptions( $query ){

if ( is_admin() )
{
$meta_keys = $query->get('meta_key');
if ( is_array($meta_keys) )
{
$query->set( 'meta_key', $meta_keys[0] );
}
}
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.

#2496563

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

This is a quick update to let you know that we have released Types 3.4.17 which includes a fix for this issue.

If the updates do not show up on your plugin installer page (click the registered link beneath the plugin name to go to the custom installer page) click the Check for Updates button to update the list.

Or you can download the latest versions from your accounts page: https://toolset.com/account/downloads

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.