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

Bensbury’s picture

Okay 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.

  if (is_string( $column_value) && strpos($column_value, '[') !== FALSE) {

You can also brace up the line at 18 which is the almost the same with the following equivalent:

if (is_string( $value) && strpos($value, '[') !== FALSE)

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.

zanix’s picture

maximpodorov’s picture

Status: Active » Fixed

This is fixed in the commit:
http://cgit.drupalcode.org/field_default_token/commit/?id=c0be10f4a7d7bd...

Please reopen the issue if the problem remains.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mastoll’s picture

It was fixed in the commit for the dev version. Will the fix be moved to the production version 1.2?

maximpodorov’s picture

The fix will go in 1.3.

mastoll’s picture

And, when will 1.3 happen?

maximpodorov’s picture

Right now.

Chris Charlton’s picture

Version 1.3 is out. No reference in this ticket there was a commit applied.