I am not sure why, but the brightcove ID numbers are sometime interpereted as a FLOAT, which totally breaks the serialization and storage in the field_FIELD_NAME_data field.

This may be their fault (or the result of JSON weirdness) but I'm implementing a fix.

Comments

joshk’s picture

In order to keep this clean, I am now doing like:

... 
  array_walk_recursive($video[$field .'_data'], '_no_floats');
...
/**
 * Walker, texas ranger
 */
function_no_floats(&$item) {
  if (Is_float($item)) {
    $item = (int) $item;
  }
}

And we are back to happy-land.

aaron’s picture

$id = (integer)$echove->createMedia('video', $filepath, $metaData); is probably better. will commit that.

aaron’s picture

Status: Active » Fixed

I've committed that to both branches now. Seems to work for me, although I hadn't noticed the behavior originally.

aaron’s picture

Status: Fixed » Needs work

so it's apparently interpreted as a float because it's such a huge number. thus typecasting it to an integer causes it to roll over... i'm going to typecast it to a string and see how that works.

aaron’s picture

Status: Needs work » Fixed

that works. committed to both branches.

Status: Fixed » Closed (fixed)

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

  • Commit e0ca41d on 6.x-2.x, 7.x-2.x by aaron:
    #888422 by aaron: Fix Brightcove ID sometimes interpreted as Float?
    
    
  • Commit fc2d1c7 on 6.x-2.x, 7.x-2.x by aaron:
    #888422 by aaron: Typecast to string.