Strange Update Problem

I have a problem when with updating events after page relaod. If I create an event and update the name without page relaod the database is updated. But if I relaod the page and try to update the event name it does not work. I thought it’s the wrong Id and the updated doesn’t work because of that but logging the sqls I looks like the wrong . The old event_name is posted. But the sheduler is showing the updated one (untill relaod). The strange thing is that updateing time, date, even the details run without any problem even after page reload.

Are you using default edit form , for name changing or some customized one ?

I don’t know what you mean. But I think I found the problem. Before relaoding the page there is no variable “event_name” posted only a varible named “text”. After the reload the is additionally a varible “event_name” posted. The “text” variable has the right value with the updated text. The “event_name” variable has the orginal text from the database.

Debugging enabled shows the following:

===================================
Log started, 30/06/2010 11:03:25AM

DataProcessor object initialized
26_TEXT => New event. updated
IDS => 26
26_DETAILS =>
FIELDNAMES => 26_ID,26_TEXT,26_EVENT_NAME,26_DETAILS,26_!NATIVEEDITOR_STATUS,IDS
26_!NATIVEEDITOR_STATUS => updated
26_START_DATE => 2010-6-18 00:00
26_ID => 26
26_END_DATE => 2010-6-18 00:05
26_EVENT_NAME => New event

Row data [26]
end_date => 2010-6-18 00:05
event_name => New event
!NATIVEEDITOR_STATUS => updated
DETAILS =>
start_date => 2010-6-18 00:00
ID => 26

UPDATE events SET start_date=‘2010-6-18 00:00’,end_date=‘2010-6-18 00:05’,event_name=‘New event’,details=’’ WHERE event_id=‘26’


So I think if the variable “event_name” is defined that value is used instead of the value for “text”

Thank you very much for your help

So I think if the variable “event_name” is defined that value is used instead of the value for “text”

Yes, if you are using custom fields in the form, the next field names must not be used

event_name
start_date
end_date
event_length
event_pid
rec_type

because they are reserved for inner usage.

I didn’t change any of the variable names or form names. It’s all in the conector examples. So want should I do now ?

Default connector’s sample sends data as

74_!nativeeditor_status updated 74_details Details for Arena Nurnberg 74_end_date 2009-12-02 16:00 74_id 74 74_start_date 2009-12-02 13:00 74_text Arena Nurnberg ids 74

There is no such parameter as event_name
The only way to add such parameter - use custom form configuration
( by any chance, are you using scheduler 2.1 or earlier ? )

can it be that all database fields are rendered as form names ?

My table looks like this
DROP TABLE IF EXISTS sampledb.events;
CREATE TABLE sampledb.events (
event_id int(10) unsigned NOT NULL AUTO_INCREMENT,
start_date datetime NOT NULL,
end_date datetime NOT NULL,
event_name varchar(45) NOT NULL,
details varchar(45) NOT NULL,
PRIMARY KEY (event_id)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;

I created the table like this because there was no table events. How should the column naming be ?

How is render_table command looks in your case?

It must be

$sched->render_table(“events”,“event_id”,“start_date,end_date,event_name,details”);

Problem can occur if you have write “event_name” 2 or more times.