Issue:
Trying to take event start of type datetime from civicrm event entity using rules and populate the Facebook Event Entity but the data types do not match.

Background:
https://www.drupal.org/project/civicrm_entity exposes civicrm objects like events as D7 Entities. The event entity is of type datetime but the fb-entity-created:field-facebook-start-time is integer. The FB API specifies datetime for the field (https://developers.facebook.com/docs/graph-api/reference/v2.0/event)

Not sure if this is a bug and I should override the FB Event Entity or there is implicit type conversion going on.

Bottom line is that Rules is unhappy.

I see there are some type issues in the rules queue: https://www.drupal.org/node/1301022

wonder if this is a bug or I'm missing something obvious.

Thanks for a GREAT MODULE for system builders!

Comments

e0ipso’s picture

Thank you for contributing in the issue queue @sonicthoughts.

Is this a duplicate of #2020465: Event start and end time incorrect format with built in event publication??

sonicthoughts’s picture

Wow - can't believe I missed that - however, after reviewing I'm still not sure why the feilds event_start and event_end are type integer?

I see there is a code check class FBAutopostEvent extends FBAutopost to convert, but not sure why you would want an integer at all I see that FB changed their Event Types, perhaps it that is why:
https://developers.facebook.com/blog/post/2012/08/01/platform-migration-...

it is now defined here:
Now defined here: https://developers.facebook.com/docs/graph-api/reference/v2.0/event
Can be modified: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0#read...
so it uses: http://php.net/manual/en/function.date.php#refsect1-function.date-parame...
. Why not make it a date type or string? Possibly run date_create_from_format() to verify type.

All the fixes referenced above seem like just workarounds.

I'm a builder, not a developer so a patch from me would be dangerous :)

I also tried to change the features definition (you can't actually change the type in drupal :() but even that got ugly as the .info file generated has a lot of features_exclude fields. I'd like to make a change that will be consistent with module upgrades.

FYI:
I realize you have the building blocks here, but the idea of taking a drupal entity with some basic fields like start date, title, description etc. and mapping to the facebook event type is really powerful for anyone trying to market events. It goes well beyond the other modules that just post to the wall!

Gracias for tanto esfuerzo and contribucion a la comunidad Drupal!