Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With this module enabled on the site, when I add a table field, I get the following error:
Warning: preg_match_all() expects parameter 2 to be string, array given in token_scan() (line 124 of /drupal/includes/token.inc).
This patch gets around it, but I'm not sure if tokens will be processed within the cells of a tablefield.
Comment | File | Size | Author |
---|---|---|---|
tablefield.patch | 653 bytes | dshields | |
Comments
Comment #1
apmsooner CreditAttribution: apmsooner commentedI'm seeing the problem as well. I closed my issue in favor of this one.
Comment #2
MrPaulDriver CreditAttribution: MrPaulDriver commentedCopying in my post from the (closed) issue at #1. Interested to know how effective the patch is.
---
This issue took a great deal of finding but I'm glad I tracked it down eventually!
Yes, concur with @apmsooner this error originates when (certain) nodes have a table field. In my case I am getting this error with product display nodes used on a commerce site. I do not get the error with basic pages though.
In the case of my product display node, it has an entityform block attached which makes use of field_default_token . I have tried interchanging tokens with entity tokens but find that the error occurs with both.
For search visibility my error is copied below.
Warning: preg_match_all() expects parameter 2 to be string, array given in token_scan() (line 124 of
Comment #3
zanixSeems to be related to these issues
#2341141: strpos() expects parameter 1 to be string
#2188677: $column_value is not checked when passed to token_replace
Comment #4
maximpodorov CreditAttribution: maximpodorov commentedThis is fixed in the commit:
http://cgit.drupalcode.org/field_default_token/commit/?id=c0be10f4a7d7bd...
Please reopen the issue if the problem remains.