• Resolved Eddie

    (@ejamesonvalleyhopeorg)


    I am importing a list of events which is currently a total of 30 items. some with multiple categories. I am using the demo template with a new name but no changes to the header row or separators. After the import, there are no new results shown. Thoughts?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Eddie

    (@ejamesonvalleyhopeorg)

    To expand, Stage 1 of the import works as I am able to browse out to the file location and select the template. Stage 2 works as it shows a list of what is going to be imported. If there is a category that does not exist, the code states that category will be removed. Step 3 is where the break occurs. Nothing is imported. I reviewed the DB and no entries exist there either.

    I tried the import without the missing categories and got the same issue. Nothing imported. I am on WP 5.0.3 and plugin version 0.8.3. Please help me get this fixed because this is exactly the type of utility we have been looking for. Thanks in advance!

    Thread Starter Eddie

    (@ejamesonvalleyhopeorg)

    @hatesspam, would you be able to connect with us?

    Sorry I am not familiar with the import functionality.

    The fact that you see the following text, suggests that at least something is working: “No events found. Please try again later.”

    On a hunch, are there any upcoming events in the import, or are they all past events? (Default filterbar setting is to only show future events.)

    What is your shortcode?

    Thread Starter Eddie

    (@ejamesonvalleyhopeorg)

    All the events I am pulling in are upcoming events, I did not enter any past events. The short code I am using is the one your provided, thanks btw:
    [event-list show_filterbar=true filterbar_items=cats_dropdown]
    It is not showing any events as I pulled the ones I already entered because I was testing a 30 event import, which is where I found the issue.

    Thread Starter Eddie

    (@ejamesonvalleyhopeorg)

    The error in the server log is:

    PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /nas/content/live/hopebuilderstg/wp-content/plugins/event-list/admin/includes/admin-import.php:199\nStack trace:\n#0 /nas/content/live/hopebuilderstg/wp-content/plugins/event-list/admin/includes/admin-import.php(57): EL_Admin_Import->show_import_finished(Object(WP_Error))\n#1 /nas/content/live/hopebuilderstg/wp-content/plugins/event-list/admin/admin.php(165): EL_Admin_Import->show_import()\n#2 [internal function]: EL_Admin->show_import_page('')\n#3 /nas/content/live/hopebuilderstg/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array)\n#4 /nas/content/live/hopebuilderstg/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)\n#5 /nas/content/live/hopebuilderstg/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#6 /nas/content/live/hopebuilderstg/wp-admin/admin.php(224): do_action('el_events_page_...')\n#7 /nas/content/live/hopebuilderstg/wp-admin/edit.php(10): require_once('/nas/content/li...')\n#8 {main}\n thrown in /nas/content/live/hopebuilderstg/wp-content/plugins/event-list/admin/includes/admin-import.php on line 199, referer: https://hopebuilderstg.wpengine.com/wp-admin/edit.php?post_type=el_events&page=el_admin_import

    Thread Starter Eddie

    (@ejamesonvalleyhopeorg)

    After digging through the code all afternoon I started from the ground up using the example import file. From there, I added different events to the list and imported. I noticed on step 2 that if there was a missing character or something that was not read right, in other words displayed a nonstandard character, like a black diamond with a ? in it… it broke. However, after going back through the import list, and cleaning up all the areas with an odd character, some of which were just blank spaces that I deleted and added back in, it worked… Seems like the import function is breaking when non-standard characters are identified in the csv.

    So, the fix, on stage 2 of the import, look for odd characters in the preview, then go back to your import list and correct it, then import again. You should see the non-standard characters disappear if you corrected them. This may be a UTM or ASCII coding issue. However, once you correct the characters, you should be fine.

    As for a code fix, I am curious if there is a way to identify the text coding and import special characters as well.

    Good that you managed to solve your problem.

    I did some digging. It seems two problems occurred.

    One is that the import process ended in a state where it had no events to review (this may well have been because of the strange characters you mentioned).

    The other is that when the plugin tried to report this to you, it failed to generate an error message.

    The second is definitely a bug.

    In admin/includes/admin-import.php,

    where it says:

    if(empty($reviewed_events)) {
    	return new WP_Error('no_events', __('No events found','event-list'));
    }

    Should become:

    $ret = array('success' => 0, 'errors' => array());
    
    if(empty($reviewed_events)) {
    	$ret['errors'][] = new WP_Error('no_events', __('No events found','event-list'));
    	return $ret;
    }

    Also, the later statement in the same method (private function import_events())

    $ret = array('success' => 0, 'errors' => array());

    may be deleted.

    That fix should take care of the error message not displaying, but not of the actual import problem.

    Let us hope the plugin’s programmer sees this and provides us with fixes.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Import produces no new events’ is closed to new replies.