Okay
  Public Ticket #2758400
CSV Import option is missing
Closed

Comments

  •  2
    lalquier started the conversation

    Hi

    I just installed and activated my copy of the calendar plugin and I seem to be missing the Import Event menu.

    Was it moved somewhere else?

    According to other support tickets, it should be under STEC -> Import Events, but as you can see in the attached image, there is nothing like that in the menu.


  •  2
    lalquier replied

    I figured it out ... there is no Import Event until a first calendar has been created, which makes sense.

    You can mark this as closed. The plugin looks great so far!

  •  2
    lalquier replied

    Is there a way to tell why a CSV import is failing? a log somewhere or a debug statement to add to php?

    I have tried various combinations of dates, and other parameters but CSV keeps returning 0 import.

    I even tried exporting a sample event to CSV and re-importing it with the 'overwrite events' ON and it is still failing.

  •  894
    Zhivko replied

    Hi,

    Could you send me your csv file to check it out? Perhaps the CSV Settings are misconfigured.


    Stachethemes Developer

  •  2
    lalquier replied

    Here is a sample file. 

    I used 'm/d/Y g:i' as the date time format.

    If that can help... I enabled error logging on Wordpress after seeing calls to Admin_Helper::debug_log in the class.import file. 

    The strange thing is that no error are reported at all. The import seems to go well except 0 events are imported.

    [23-Apr-2021 12:28:38 UTC] STEC LOG :: Import job importing D:\path\to\php\tmp\php26B3.tmp to calendar 6806
    [23-Apr-2021 12:28:38 UTC] STEC LOG :: Import job  imported

    I also verified the php\tmp folder is writeable. I can see the temp file being created and deleted during the import process.

  •  2
    lalquier replied

    I added some debug statements to see what is happening and it looks like for some obscure reason, the Title column is ignored in the parsing of the file.

    Here is the output for the first row of the sample file I attached in my previous message:

    All keys are matched except the title.

    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :: Reading CSV file
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :: CSV file parsed
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::: Reading event from file
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key:  - Value: 2020 Spring TS Co-ops
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: start_date - Value: 12/8/2020 9:00
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: end_date - Value: 12/8/2020 9:00
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: hide_end - Value: 1
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: all_day - Value: 0
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: rrule - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: exdate - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: recurrence_id - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: description - Value: Our 2020 Spring Co-ops share their experiences and learnings during this interesting year<br>
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: description_short - Value: Our 2020 Spring Co-ops share their experiences and learnings during this interesting year
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: location_address - Value: iTalk NA
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: location_city - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: location_country - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: location_details - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: location_coordinates - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: location_type - Value: virtual
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: color - Value: #c800a1
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: icon - Value: fas fa-comment
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: featured - Value: 0
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: categories_id - Value: North America (NA),Corporate,iTalk NA
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: link - Value: https://web.microsoftstream.com/video/uuid
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: link_text - Value: Video
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: keywords - Value: co-ops
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: images - Value: 
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: rsvp - Value: 0
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: rsvp_limit - Value: 0
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: attendance_visibility - Value: public
    [23-Apr-2021 13:40:06 UTC] STEC LOG :: :::::: Event key: author - Value: LAURENT ALQUIER



  •  2
    lalquier replied

    I figured it out... the clue was when I tracked down how the file was parsed and found out it didn't detect the Title column.

    I even compared the strings in two ways and got the same result - 'Title' is not 'Title.

    [23-Apr-2021 15:33:35 UTC] STEC LOG :: :: Reading event from file
    [23-Apr-2021 15:33:35 UTC] STEC LOG :: :: get_event_assoc_field - comparing :Title: and : Title:
    [23-Apr-2021 15:33:35 UTC] STEC LOG :: ::      Using :Title: === : Title: = Result: 
    [23-Apr-2021 15:33:35 UTC] STEC LOG :: ::      strcmp :Title: , : Title: = Result: -1

    That pointed me to the direction of an invisible character at the start of the file (CSV wit hBOM).

    Here's an article about how to get rid of it in PHP: https://medium.com/@choco14t/handle-csv-of-utf-8-with-bom-in-php-40df930de7b1 

    Once I removed that character from my CSV file, events were imported into the Calendar.

  •  894
    Zhivko replied

    Thank you for the info. I'll take a look at this.


    Stachethemes Developer