I get the following error when trying to load a migration class which has a date field mapping:

Fatal error: Declaration of MigrateDateFieldHandler::prepare() must be compatible with that of MigrateFieldHandler::prepare() in sites/all/modules/migrate_extras/date.inc on line 3

The attached patch fixes the error.

Comments

mikeryan’s picture

Status: Needs review » Closed (duplicate)

This was already done, please pull the latest code: http://drupalcode.org/project/migrate_extras.git/commit/e5791fd

rvanderh1’s picture

Sorry, but where exactly does the patch go? I pasted the code in the date.inc template at the top, but now I get this error:
Parse error: syntax error, unexpected T_DEC in /sites/all/modules/migrate_extras/date.inc on line 3

I'm using Migrate and Migrate_Extras 6.x-2.0

ClearXS’s picture

"This was already done, please pull the latest code: http://drupalcode.org/project/migrate_extras.git/commit/e5791fd "
=> That indeed is the code of the latest module I've installed, but gives that white error page after update.php with exactly the here mentioned error message.

The patch Stella mentions IS NOT in the latest release, I have no idea if its correct (don't know about PHP), but have changed this in:
modules/migrate_extras/date.inc

-  public function prepare($entity, array $instance, array $values) {
+  public function prepare(stdClass $entity, array $instance, array $values) {

(there are programs that automatically make those changes, but I just get rid of lines with a "-" in front and put there the line(s) after a "+")

ClearXS’s picture

Status: Closed (duplicate) » Needs review

Sorry for opening again; request confirmation if this is the patch for this error, or if there is a link to another patch?

mikeryan’s picture

Status: Needs review » Closed (works as designed)

I misspoke. The current migrate_extras code (without the stdClass) is correct for the latest Migrate dev release, but won't work with Migrate 2.0. I'm afraid I confused things by forgetting to release Migrate Extras 2.0 at the same time as Migrate 2.0 - I later noticed the omission and released Migrate Extras 2.0, but after having made this change to the Date support so it Migrate Extras dev would work with Migrate dev. Things will get back in sync with Migrate/Migrate Extras 2.1, but for now you need to be using the Migrate dev release.