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.
Hi,
I get this error warning in the Content Type display screen when updating the display settings.
It doesn't seem to matter if any of them are displayed or hidden.
Values with the default option exist but do not use a token as a default value, so maybe something is being passing to the function when the input for the token is empty?
Warning: strpos() expects parameter 1 to be string, array given in field_default_token_field_update_instance() (line 23 of /www/befc/live/public/sites/all/modules/field_default_token/field_default_token.module).
Comments
Comment #1
Bensbury CreditAttribution: Bensbury commentedOkay I have fixed this by doing the following.
I'm not a programmer so I can't give you one of those sexy patch files for review, but I will put the code in here:
I changed line 23 to the following because it is not always guaranteed the $column_value passed into this function is in fact a string.
You can also brace up the line at 18 which is the almost the same with the following equivalent:
Looks like it makes sense to me because by failing the conditional the $has_tokens variable will stay as false, which is correct.
If this doesn't mess up anything I hope it solves the problem and maybe makes the code more robust.
Cheers.
Comment #2
zanixSeems to be related to these issues
#2188677: $column_value is not checked when passed to token_replace
#2301669: Doesn't work with Tablfield
Comment #3
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.
Comment #5
mastoll CreditAttribution: mastoll commentedIt was fixed in the commit for the dev version. Will the fix be moved to the production version 1.2?
Comment #6
maximpodorov CreditAttribution: maximpodorov commentedThe fix will go in 1.3.
Comment #7
mastoll CreditAttribution: mastoll as a volunteer commentedAnd, when will 1.3 happen?
Comment #8
maximpodorov CreditAttribution: maximpodorov commentedRight now.
Comment #9
Chris CharltonVersion 1.3 is out. No reference in this ticket there was a commit applied.