Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter motionltd

    (@motionltd)

    Further info. When it breaks and tells me theres an error the date goes back to 1970 and only gives me a date range in the 70s and 80s!

    Cheers

    Ben

    Same problem here. Looks like something was broken in the last update.

    Plugin Author mibuthu

    (@mibuthu)

    In the actual version the error messages are really bad, so it is difficult to identify the problem.

    Can you please check the webserver log files. I think there must be some php warnings or errors which would help to identify the problem.

    Here are the errors in the log:

    Notice: Undefined index: id in wp-content/plugins/event-list/admin/includes/admin-new.php on line 63

    Notice: Trying to get property of non-object in wp-content/plugins/event-list/admin/includes/admin-new.php on line 64

    Notice: Trying to get property of non-object in wp-content/plugins/event-list/admin/includes/admin-new.php on line 65

    Notice: Undefined index: id in wp-content/plugins/event-list/admin/includes/admin-new.php on line 89

    Plugin Author mibuthu

    (@mibuthu)

    O.k. I can reproduce this warnings and also the date issue after a new event was added with an error. I will fix this in the next version.

    But this is not the source of the this problem here.

    Can you please change the code from line 143 in event-list/includes/db.php to:

    else { // new event
    		$wpdb->insert($this->table, $sqldata, $sqltypes);
    		error_log($wpdb->last_query);
    		$wpdb->print_error();
    		return $wpdb->insert_id;

    and give me the result of your error logfile again.

    Thanks.

    No new errors:

    Notice: Undefined index: id in /wp-content/plugins/event-list/admin/includes/admin-new.php on line 63

    Notice: Trying to get property of non-object in /wp-content/plugins/event-list/admin/includes/admin-new.php on line 64

    Notice: Trying to get property of non-object in /wp-content/plugins/event-list/admin/includes/admin-new.php on line 65

    Notice: Undefined index: id in /wp-content/plugins/event-list/admin/includes/admin-new.php on line 89

    Plugin Author mibuthu

    (@mibuthu)

    Hmm, so you do not get to this point already.

    Can you please try to add an error_log entry at the beginning of the update_event function after line 99 to test if you reach this point, e.g.:

    public function update_event($event_data) {
         error_log("Test");

    If you can see the “Test” message in your error log the script reaches this point. Can you please move this line downwards in this function until you can’t see it in your logs. So we can figure out the actual problem.

    Thanks for your help in advance.

    The “Test” never appears in the error_log. So I just did a fresh install of WordPress and enabled error logging to a specific file. Installed the plugin and the same error message appeared, but now I have an error for you:

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 1’ at line 1 for query SELECT * FROM wp_event_list WHERE id = LIMIT 1 made by do_action(‘toplevel_page_el_admin_main’), call_user_func_array, EL_Admin->show_main_page, EL_Admin_Main->show_main, EL_Admin_Main->show_edit_view, EL_Admin_New->edit_event, EL_Db->get_event

    Any update on this? I’ve about exhausted everything I can think of. Would love to use your plugin, but its not looking good right now.

    Plugin Author mibuthu

    (@mibuthu)

    Sorry, still no idea. All the error messages you have got are from loading a non existing event after an error. I will fix this in the next version, but it has nothing to do with the actual error while creating the event.
    Like I already said the error messages are really bad at the moment, so it is very difficult to identify the problem.

    You have said, that you cannot see the “Test” in your error log even if you enter the command at the beginning of the update_event function. So we have to go more backwards and start from the beginning.

    Can you please try:

    event-list/admin/admin-main.php, line 33:

    if($this->action) {
        error_log("Test 1");

    event-list/admin/admin-main.php, line 191:

    private function update_event() {
        error_log("Test 2");

    Thanks in advance.
    I will try to answer you faster than the last times.

    I got the “Test 1”, but not the “Test 2”.

    Plugin Author mibuthu

    (@mibuthu)

    We get closer but we are unfortunately not finished yet.

    I need some more information. Next things to try:

    event-list/admin/admin-main.php, line 27:

    private function __construct() {
    		$this->db = &EL_Db::get_instance();
    		$this->filterbar = &EL_Filterbar::get_instance();
    		$this->event_table = new EL_Event_Table();
    		$this->action = $this->event_table->current_action();
    		error_log("Action: ".$this->action);
    		foreach($_GET as $key => $value) {
    			error_log('GET value "'.$key.'": '.$value);
    		}
    		foreach($_POST as $key => $value) {
    			error_log('POST value "'.$key.'": '.$value);
    		}
    		// check for real actions
    		if($this->action) {
    		...

    Please post everything you get in your error log after clicking “Publish”.

    Thanks.

    Here you go:

    [03-Jun-2014 17:38:00 UTC] Action: new
    [03-Jun-2014 17:38:00 UTC] GET value "page": el_admin_main
    [03-Jun-2014 17:38:00 UTC] GET value "noheader": true
    [03-Jun-2014 17:38:00 UTC] POST value "autosavenonce": c35c38bd8f
    [03-Jun-2014 17:38:00 UTC] POST value "closedpostboxesnonce": 66ba9ef591
    [03-Jun-2014 17:38:00 UTC] POST value "meta-box-order-nonce": 10abeecb6d
    [03-Jun-2014 17:38:00 UTC] POST value "action": new
    [03-Jun-2014 17:38:00 UTC] POST value "title": Test Event
    [03-Jun-2014 17:38:00 UTC] POST value "start_date": June 04, 2014
    [03-Jun-2014 17:38:00 UTC] POST value "end_date": June 05, 2014
    [03-Jun-2014 17:38:00 UTC] POST value "multiday": 1
    [03-Jun-2014 17:38:00 UTC] POST value "sql_start_date":
    [03-Jun-2014 17:38:00 UTC] POST value "sql_end_date":
    [03-Jun-2014 17:38:00 UTC] POST value "time": 7:00 AM - 8:00 PM
    [03-Jun-2014 17:38:00 UTC] POST value "location": 123 Any Street
    [03-Jun-2014 17:38:00 UTC] POST value "details": <p>This is a test event.</p>
    [03-Jun-2014 17:38:00 UTC] POST value "publish": Publish
    [03-Jun-2014 17:38:00 UTC] POST value "categories": Array
    [03-Jun-2014 17:38:01 UTC] Action: added
    [03-Jun-2014 17:38:01 UTC] GET value "page": el_admin_main
    [03-Jun-2014 17:38:01 UTC] GET value "action": added
    [03-Jun-2014 17:38:01 UTC] GET value "error": 1
    [03-Jun-2014 17:38:01 UTC] GET value "title": Test Event
    [03-Jun-2014 17:38:01 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1 for query SELECT * FROM wp_event_list WHERE id =  LIMIT 1 made by do_action('toplevel_page_el_admin_main'), call_user_func_array, EL_Admin->show_main_page, EL_Admin_Main->show_main, EL_Admin_Main->show_edit_view, EL_Admin_New->edit_event, EL_Db->get_event
    Plugin Author mibuthu

    (@mibuthu)

    Wow you are very fast.
    This output helps a lot. The problem seems to be the missing (empty) values for “sql_start_date” and “sql_end_date”, but I still don’t know why?
    These fields are empty at the beginning but should be automatically filled via javascript while loading the page. This doesn’t seem to work in your installation.

    So some questions:

    Which browser do you use?

    Can you please inspect the New event page after loading? After the visible fields start_date, end_date and multiday you can find the 2 hidden fields sql_start_date and sql_end_date. Are they already empty
    after loading the New event page? Does it change when you change the date with the date picker?
    (Please note: It is not enough when you look at the page source because there these fields are definitely empty. You have to use the inspector of your browser.)

    Can you please check if your browser shows some javascript errors or warnings while loading the page?

    Thanks in advance.

    Sorry about the delay… I have been out sick for a couple days…

    I have tried this on Firefox, Safari & Chrome.

    The new event page generates no errors for php or JavaScript, the two hidden fields are empty on load and when entering the date in the picker, it does not update the hidden fields.

    (Just a thought… since it appears that these fields are used to reformat the date for the sql, would it not be better to handle that post submit and eliminate the JavaScript for that entirely? Could be an easy fix.)

    There are 3 errors listed in the inspector that are CSS related:

    [Warning] Invalid CSS property declaration at: * (global.css, line 65)
    [Warning] Invalid CSS property declaration at: ; (admin.php, line 67)
    [Warning] Invalid CSS property declaration at: * (admin.php, line 88)

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘No Event Added Error’ is closed to new replies.