I replicated the steps of the README.txt file. The first time I tried to import content I got that white screen with the text: "The website encountered an unexpected error. Please try again later." I clicked the back arrow in my browser and tried to import content again. This time only the fields title and body were imported.
I erased all content, uninstalled the module, cleared all caches (included the cache tables in the DB) and installed the module again.
Same result!
The log has following messages (see attachments).

Comments

jorgemontoyab created an issue. See original summary.

Ujwala_D’s picture

Assigned: Unassigned » Ujwala_D
carl.ben’s picture

This error was fixed for me by editing the mySQL config file (my.cnf):
max_allowed_packet = 256M

Ujwala_D’s picture

Status: Active » Needs review
StatusFileSize
new719 bytes

@jorgemontoyab,

The error came due to php function 'createFromFormat' which requires the format of passing date, which is unpredictable. So I have create date through timestamp. Please find an attachment for the solution.

Thanks

jorgemontoyab’s picture

@Ujwala_D
Thanks! That solves the problem. However, you have to target line 275 in the patch file for the version 8.x-3.2 of the module and not line 264.

jorgemontoyab’s picture

Status: Needs review » Fixed
jorgemontoyab’s picture

Issue summary: View changes
Anonymous’s picture

@Ujwala_D

I imported a CSV file containing a date. First time, it worked. I was happy. I tried it again with a clean install and stumbled over the message:

The website encountered an unexpected error. Please try again later.

I followed your instructions but it didn't help. I can import files but only the titles show up. No other data is displayed. Going into the database, I see the dates stored. I have a CSV file with a date only—no time. I tried different PHP codes at:

 case 'datetime':
  $dateTime = \DateTime::createFromFormat('Y-m-d h:i:s', $data[$keyIndex[$fieldNames[$f]]]);
  $newDateString = $dateTime->format('Y-m-d\Th:i:s');
  $nodeArray[$fieldNames[$f]] = ["value" => $newDateString];
  break;
  • your code:
case 'datetime':
  $dateTimeStamp = strtotime($data[$keyIndex[$fieldNames[$f]]]);
  $newDateString = date('Y-m-d\TH:i:s', $dateTimeStamp);
  $nodeArray[$fieldNames[$f]] = ["value" => $newDateString];
  break;
  • and something like:
case 'datetime':
  $nodeArray[$fieldNames[$f]] = ["value" => $data[$keyIndex[$fieldNames[$f]]]];
  break;
  • or:
 case 'datetime':
  $dateTime = \DateTime::createFromFormat('Y-m-d', $data[$keyIndex[$fieldNames[$f]]]);
  $newDateString = $dateTime->format('Y-m-d');
  $nodeArray[$fieldNames[$f]] = ["value" => $newDateString];
  break;

It didn't help. The data doesn't show up though it is in the database. I tried different codes with such results in the database:

2012-08-27 (a date like it should be)
1970-01-01 (something went wrong)
2012-08-27T00:00:00 (date and time)

To be clear: I definitely don't want a time, just a date. The problem is that all data doesn't show up except the title.

P.S. The first time, I had several migration modules installed: Migrate Plus, Migrate Source CSV…

Anonymous’s picture

Status: Fixed » Active
hongpong’s picture

I had a similar issue and adding max_allowed_packet = 256M into the [mysqld] section specifically worked. see #2941051: Problem with uninstalling module: database goes away

dhayanandan_k’s picture

@20 Drei, I have replaced the code for Datetime import in dev version. Now it will work for both datetime and date fields.
@HongPong, the uninstall is working fine with dev version. Please verify

dhayanandan_k’s picture

Status: Active » Fixed
hongpong’s picture

@dhayanandan_k my problem went away when I changed my mysql settings, therefore I could say the problem was not specific to the module. Best regards!

Status: Fixed » Closed (fixed)

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