Scheduler module : calendar event issue resolved. 2008021600 published.

Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -
Number of replies: 45

This is an annoying bug fix that is out :

The scheduler did not properly remove calendar events when a student was changing its appointment. It's OK now.

Scheduler was experimented with success on a 180 appointement set over 3 weeks : less than 15 minutes overcrowd and no unexpected annulation on passed 110 meetings !!

Average of ratings: -
In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
We're trying to include the scheduler module into our moodle installation and roll it out next semester.
But it doesn't seem to work for us. We are using moodle 1.8.4 and it installs correctly. Also the database tables are being created.
In courses one can add the activity "Scheduler" and make entries for students. But in the result, students doesn't see the entries for possible dates. I attached a screen shot for demonstrating this. For me it looks like there should be a table where all dates should be enlisted. But there isn't one.

Maybe someone can help us to get it working?

Regards
Sven
Attachment scheduler.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Hi Sven, first of all do you have the last edited version of the scheduler ? If not get it here.

You should have version 2008021600 which is the last fixed version.

Other thing you could check out : you should have three scheduler tables : mdl_scheduler, mdl_scheduler_slots and mdl_scheduler_appointment, if not, you may run a new code over an old tableset, as we had some difficulties to have the upgrade running Ok for a while.

If the table model seems to be old, just uninstall and reinstall the scheduler module (uninstall, keep the files where they are and browse once again to admin->notifications).

Once you checked this, it should run nicely.

Cheers.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Thank you for your reply.
I'm sure, i used the latest available version (release 6) and i just deinstalled any previous version.
To be certain i just downloaded and installed a plain vanilla moodle installation and set up this on a new virtual box.
But i can tell you it does NOT work.
I can create a series of dates off which students should choose one, but neither the teacher nor the students can see this list/table.
After creating this series of dates your mod states that it created them, i also can export this list, but it never is showed up in moodle.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Well, let's check some technical things :

  • Running the query :

SELECT *
FROM mdl_capabilities
WHERE name LIKE 'mod/scheduler%'

in your PhpMyAdmin should have following results

224 mod/scheduler:appoint write 70 mod/scheduler 0
229 mod/scheduler:attend read 70 mod/scheduler 0
193 mod/scheduler:canscheduletootherteachers read 70 mod/scheduler 0
226 mod/scheduler:disengage write 70 mod/scheduler 0
225 mod/scheduler:manage write 70 mod/scheduler 0
192 mod/scheduler:manageallappointments read 70 mod/scheduler 0
227 mod/scheduler:seeotherstudentsbooking read 70 mod/scheduler 0
228 mod/scheduler:seeotherstudentsresults read 70 mod/scheduler 

(except for id numbers which will be yours and not mine --- We check existence of capabilities ).

  • Running the query :

SELECT *
FROM `mdl_role_capabilities`
WHERE capability LIKE 'mod/scheduler%'
AND contextid =1

should show 39 lines of answer, which are the capabilities of the CONTEXT_SITE level (capabilities that will apply as default).

  • Other check :

Setting debug level to "All errors" might show us an hidden php error message that could have raised locally on your implementation. Try setting for a moment such debug level and try back showing slots.

  • Last check :

When adding slots, check dates are in allowed days. I made that mismatch once and was stonished with the result.

We'll keep on trying to see what's wrong there...

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Thanks for your help. Here are my results:

Check #1: "SELECT * FROM mdl_capabilities WHERE name LIKE 'mod/scheduler%';"
It gives me the following:
mod/scheduler:appoint | write | 70 | mod/scheduler | 0
mod/scheduler:attend | read | 70 | mod/scheduler | 0
mod/scheduler:manage | write | 70 | mod/scheduler | 0
mod/scheduler:manageallappointments | write | 70 | mod/scheduler | 0
mod/scheduler:canscheduletootherteachers | write | 70 | mod/scheduler | 0
mod/scheduler:disengage | write | 70 | mod/scheduler | 0
mod/scheduler:seeotherstudentsbooking | read | 70 | mod/scheduler | 0
mod/scheduler:seeotherstudentsresults | read | 70 | mod/scheduler | 0

Which looks quite the same as yours in both of my installations. Except for some diff in read/write...

Check #2: "select * from mdl_role_capabilities where capability like 'mod/scheduler%' and contextid=1;"
Here we have a little difference in between both installations. The database of my "normal" testing system seems not to select anything with this query, it returns 0 rows. My newly installed system is quite different, it returns 40 rows instead of the 39 you said.

Check #3: Setting debug level higher:
This gives me the same error on both of my installations (sorry, it is put out in german. do you need a translation?). I'll attach a screenshot of this also:
FEHLER: Syntax LIMIT x,y wird nicht unterstützt HINT: Verwenden Sie die getrennten Klauseln LIMIT und OFFSET.

SELECT s.*, COUNT(IF(a.studentid IS NOT NULL, 1, NULL)) as isappointed, COUNT(IF(a.attended IS NOT NULL AND a.attended > 0, 1, NULL)) as isattended FROM mdl_scheduler_slots AS s LEFT JOIN mdl_scheduler_appointment AS a ON s.id = a.slotid WHERE schedulerid = '1' AND teacherid = '2' GROUP BY s.id ORDER BY starttime ASC LIMIT 0, 25
  • line 677 of lib/dmllib.php: call to debugging()
  • line 918 of lib/dmllib.php: call to get_recordset_sql()
  • line 412 of mod/scheduler/teacherview.php: call to get_records_sql()
  • line 102 of mod/scheduler/view.php: call to include()
Check #4: What do you mean with allowed days? Where can i configure these?

I hope this helps you a bit for debugging? By the way, we don't use MySQL, we use Postgres. Maybe that is a problem? The error in check 3 seems to be related to the database...
Attachment scheduler_error.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Of course it helps...

It seems that Postgress do not implement the LIMIT,OFFSET statement that allows result pagination when querying a heavy loaded table. I don't know how to bypass that problem right now, and I suspect many other module do use such limitation syntax in their queries.

I will ask Tim Hunt about that issue to check he has a portable method for that page limiting feature. I guess it would not really work on Oracle either.

As we would really like Moodle being dataase independant, I will check that particular point and review the Scheduler code if a solution can be found to that.

Obviously, this error is the master cause why you get no slots !! Slots cannot be fetched at all !!

Cheers.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Thanks for the information. Maybe the error message contains the solution already?
"FEHLER: Syntax LIMIT x,y wird nicht unterstützt HINT: Verwenden Sie die getrennten Klauseln LIMIT und OFFSET."

There is a help page in the postgresql documentation at http://www.postgresql.org/docs/8.1/interactive/queries-limit.html .

Maybe that helps.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Ok, i did a quick search over mod/scheduler for the expression "LIMIT" and found only one inside teacherview.php.
Here i changed the code to
LIMIT 25
OFFSET ".($offset * 25)."

If i run the scheduler now, it seems to raise another error:
FEHLER: Funktion if(boolean, integer, "unknown") existiert nicht HINT: Keine Funktion stimmt mit dem angegebenen Namen und den Argumenttypen überein. Sie müssen möglicherweise ausdrückliche Typumwandlungen hinzufügen.

SELECT s.*, COUNT(IF(a.studentid IS NOT NULL, 1, NULL)) as isappointed, COUNT(IF(a.attended IS NOT NULL AND a.attended > 0, 1, NULL)) as isattended FROM mdl_scheduler_slots AS s LEFT JOIN mdl_scheduler_appointment AS a ON s.id = a.slotid WHERE schedulerid = '2' AND teacherid = '3' GROUP BY s.id ORDER BY starttime ASC LIMIT 25 OFFSET 0

It seems to me, Postgres doesn't support "IF" statements that way?
Unfortunately i didn't find anything helpful on the postgresql homepage.
IF-Statements exist in the PL/PGSQL procedural language (http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html).
But there seems to be no SQL keyword "IF" in "http://www.postgresql.org/docs/8.1/interactive/sql-keywords-appendix.html".
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

LIMIT/OFFSET

The best way is to use the extended parameter list of the get_record_... functions :

$slots = get_records_sql($sql, $offset * 25, 25);

getting rid of proprietary SQL markup.

IF

I think the best way is to split the query in more simple parts. So the syntax could be pulled back to more compatible writings, despite of the performance (but here this should not have seemfull influence I guess).

I'll tell you about how to rewrite this ASAP.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
I tried out the new release 7 but it seems, there has been no change for our problem?
Can you tell us, when do you expect to have the problem fixed?

Regards
Sven
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Hi Sven,

I'm terribly upset by this. You're right, the release 7 do not solve this compatibility issue.

I worked a bit on the problem. There are some heavy duty queries that make multiple count compilation like this :

            SELECT
                s.*,
                MAX(a.studentid = {$studentid}) as appointedbyme,
                MAX(a.studentid) as appointed,
                COUNT(IF(a.attended IS NULL OR a.attended = 0, NULL, 1)) as attended,
                COUNT(IF(a.studentid IS NULL, NULL, 1)) as population
            FROM
                {$CFG->prefix}scheduler_slots AS s
            LEFT JOIN
                {$CFG->prefix}scheduler_appointment AS a
            ON
                a.slotid = s.id
            WHERE
                s.schedulerid = {$schedulerid}
             GROUP BY
                s.id
             HAVING
                ((s.exclusivity > 0 AND population < s.exclusivity) OR
                s.exclusivity = 0) OR appointedbyme
             ORDER BY
                s.starttime ASC

There are two or three queries like this that allows counting several conditional situations over one unique table product scan.

these are mainly in locallib.php, at §213 in  

function scheduler_get_available_slots($studentid, $schedulerid, $studentside=false){

...

}

The other one resides in teacherview.php §523

    SELECT
        s.*,
        COUNT(IF(a.studentid IS NOT NULL, 1, NULL)) as isappointed,
        COUNT(IF(a.attended IS NOT NULL AND a.attended > 0, 1, NULL))
as isattended
    FROM
        {$CFG->prefix}scheduler_slots AS s
    LEFT JOIN
        {$CFG->prefix}scheduler_appointment AS a
    ON
        s.id = a.slotid
    WHERE
        {$select}
    GROUP BY
        s.id
    ORDER BY
        starttime ASC

 These are obviously the two key points. Maybe you would like to change these to simpler queries, splitting them for getting the actual result. I think teacherview.php's one is easy, because counts are not involved in SELECT clauses. Might be harder for the former. I still didn't have time for this by now as we are in a heavy range with end of semester overbooking.

If you don't know how to find a way, I should spend a bit time on them before end of March...


 

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Hi,

i've seen version 9 of the scheduler module is out. But again, i can't use it with postgres. Maybe you have some time for rewriting the sql statements so it's compatible with PostgreSQL?
We would be really glad.

Best regards
Sven
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -
I'll try to program that rewriting ASAP.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Hi Sven,

here come two VERY IMPORTANT patches for you. I would very like you try them to check if compatibility is restored for PostgressSQL :

Both patches get rid of the IF() function in the SQL :

teacherview.php §523 : here is the rewriting for that complex query :


Then comes the patch for the other ocurence of IF() functions :

locallib.php §217 :

function scheduler_get_available_slots($studentid, $schedulerid, $studentside=false){
    global $CFG;
    
    }

We should start have real results I hope on your instance of Moodle.

The patch applies on a Release 9, and should be propagated to next releases if you tell me it works fine on yours.

Cheers. 

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Hi Valery,

first i want to thank you for your fast response.
I think we are on a good way. But still there are a few obstacles in our way wink
The patches seem to work but the one in teacherview.php seems to contain an error. After creating timeslots i get the following warning message (debugging activated) on the first tab:
Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/html/moodle/mod/scheduler/teacherview.php on line 544

Warning: Invalid argument supplied for foreach() in /var/www/html/moodle/mod/scheduler/teacherview.php on line 544

Maybe it is not an error, but it should be checked if slots!=NULL?

I'll post every issue a find in an separate posting.
Attachment scheduler_error3.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
This error seems only to occur if i view it as administrator. As a teacher it seems to be ok.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Sure it does !!

$slots = get_records_select('scheduler_slots', $select, 'starttime', '*', $offset * 25, 25);
if ($slots){
    foreach(array_keys($slots) as $slotid){
        $slots[$slotid]->isappointed = count_records('scheduler_appointment', 'slotid', $slotid);
        $slots[$slotid]->isattended = record_exists('scheduler_appointment', 'slotid', $slotid, 'attended', 1);
    }
}

is a much cleaner code. Fixed in development version.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Next issue:

If i click on the tab "overview" i get another error.
FEHLER: Spalte »s.starttime« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendent werden

SELECT COUNT(*) FROM mdl_course as c, mdl_scheduler as sc, mdl_scheduler_appointment a, mdl_scheduler_slots s, mdl_user u1, mdl_user u2 WHERE c.id = sc.course AND sc.id = s.schedulerid AND a.slotid = s.id AND u1.id = a.studentid AND u2.id = s.teacherid AND u2.id = '3' ORDER BY s.starttime



Attachment scheduler_error2.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
This error can be reproduced as i log in as a teacher.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

The ORDER BY clause is completely idiot for this count query !! rouge

delete ORDER BY s.starttime !!

MySQL is not strict enough to check that SQL inconsistency. Obviously Postgress is !!

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
And the last one i found for now:

If i'm logged in as a student and want to book one time slot, i get the following:
FEHLER: NULL-Wert in Spalte »grade« verletzt Not-Null-Constraint

INSERT INTO mdl_scheduler_appointment ( ID, SLOTID, STUDENTID, ATTENDED, TIMECREATED, TIMEMODIFIED ) VALUES ( 1, 11, 23, 0, 1207038786, 1207038786 )


This seems to be a real error, the former two need more testing.
Attachment scheduler_error4.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -
Change the NULL status of the grade field in the database (table scheduler_appointment). It should be natural that new appointment freshly appointed have no grade at all, thus recording a NULL. Grade might be overriden later, when the teacher grades the meeting. 
In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Sorry, i just found another one:

If i click on tab "statistics", and then on tab "by group size" i get the following error:


FEHLER: Spalte »s.duration« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendent werden

SELECT s.starttime, COUNT(*) as groupsize, s.duration FROM mdl_scheduler_slots s LEFT JOIN mdl_scheduler_appointment a ON a.slotid = s.id WHERE a.studentid IS NOT NULL AND schedulerid = '2' GROUP BY s.starttime ORDER BY groupsize DESC


I get it also as a teacher.
Attachment scheduler_error5.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -
Major of these reports seems being easily fixable. I'll check them tonight. 
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

On that last query §213 of viewstatistics.php 

just

SELECT
                s.starttime,
                COUNT(*) as groupsize,
               
            FROM

Should resolve the problem, as duration has the same value for all appointements at the same starttime in this scheduler. This form is once more stricter, and will also cope with strictness of Oracle aggregation rules.

I made all changes at home, and will check for correct behaviour of the module.

This might be a chance for scheduler's future that you were working on a stricter environment.

I'll check two problematic group API calls for 1.9compatibility JErome Demiaux told me before validating release 10.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Hi Valery,

thank you, thank you, thank you... smile
All problems could be fixed now and hopefully there will be no more.
But i still have one thing in mind. If a slot is attended, the date is inserted into the calendar of the trainer as in the calendar of the student. But if the trainer deletes all dates without rejecting the attended time slots, those entries in the calendars are still there. This seems to me as being a bug.
Oh, and there seems to be an icon missing called "no.gif". I could find it in the scheduler resource as it isn't in whole moodle.

But again, thanks for this nice activity...
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

no.gif : I found it in the pix/s folder, but maybe it is not a standard icon, and it was added by a plugin. I will take it back within the scheduler to avoid that miss.

For events, actually the code do (or tries) to delete all events when deleting a slot from the list (using "delete selection" link above the slot list, or clicking on the delete cross icon). At least should it...

Would you mind tell me exactly the process you used as you noticed events were till there ?

Thanks.

Attachment no.gif
In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
I found the "no.gif" in our moodle installation now...

I'll tell you the exact process, need to examine it again with english language activated.
But we found still one "bug" more. If i choose "Students can only register one appointment at a time", i think students should be able to choose more thanm one appointement, but not at the same day? Am i right or am misunderstanding something?

If i am right, students can only choose one appointment and no more.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

No, sorry but you are actually mistaken.

This options only allows that appointment become available again when the "seen" mark is enabled on the appointment.

This option was made for long run projects meetings, so that students MUST have concluded the next dated meeting to be allowed to reengage a new date. This allows multiple appointements to be kept in the same scheduler, and compile a single grade for them, either max or mean of all passed appointments.

When choosing the other value, students that have appointed and concluded meeting WOULD NEVER be allowed to appoint again. Scheduling is over for them.

Valery.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Oh ok, i see, there i really have made a mistake... wink
But now it's clear and i understand. Maybe the german translation was a bit confusing, i'll have a look if we can make it more precise.

Thanks for now, i will post again for the other problem.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

I recently got updated files from Ralf Hilgenstock,

maybe getting these new files could be of some help, Ralf added helpers in German. We just miss the mail templates now. They are available from CVS.

Regards.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Hi Valery,

i found again some weird behaviour ot scheduler and i need some explanations.
1. What do all those different delete buttons mean? Ok, "Delete all slots" and "my unused slots" seems to be clear. But what is the difference between the two other buttons "Delete all unused slots" and "unused slots"? To me it's not clear, both sound the same.
2. I clicked on "my unused slots" which led to deleted appointed slots with out removing the appointments from my calendar and from the calendar of the student.

I'm surprised to see that the scheduler checks for collisons when adding new slots. It's nice!
What is the next future of scheduler? I would like to see sharing schedulers over more than one course. This is because many teachers will have not only one course but mostly time once or twice a week for students to attend.
Attachment scheduler_delete.png
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Hi Sven, the exact meaning of the button should be told there :

http://docs.moodle.org/en/Scheduler:_My_Appointments

There was a confusing label in the last release.

Basically the four use cases are :

  • I want to delete all slots for every one (the Atilla call !!)
  • I want to delete all slots unused whoever they belong to (closing all scheduling offer)
  • I want to delete all my unused slots, keeping old appointed records I did
  • I want to delete all my slots, appointed or not, but letting the scheduling offer of collegues unchanged.

I should have updated labels in the lang files... I hope.

Deleting unused slots SHOULD NOT let events in the calendar, as there SHOULD not exist any events for that slots. If it does, it is a bug. If you delete all your personal slots, events for appointed but not met students should disappear, once again, if they do not, its also a trailing bug. Events for other teacher meetings will not be removed.

Collisions : the proper of a good information system is getting your information consistent from your point of view. This was essential that you could not make slots in a course when you be already engaged elsewhere.

Shared schedulers : working with Michael Schwab (Germany) were some enhancements in the direction : the summary screen summaries all appointments of all your schedulers. The page style is a bit rough and might be reviewed (css related). 

Future of scheduler : except for light enhancements and trailing bug fixes, Scheduler should not change a lot from now. I'm now engaged in other developements such as the CodeTrainer module for teaching programming skills online, and have to finish a more general project with Task, TimeTrack and Techproject for student project control.

Regards.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Hi,

thanks for your extended explanation, this makes things a lot clearer.
Two things:
1. If i click one of those buttons to delete my (unused or all) slots, i'm not asked if i am sure to do that. Clicking on the other buttons (the ones for all slots) i am asked. So maybe this should be changed so user is asked always...?
2. This seems to be true for the button on the right side (delete all my slots), clicking it, deletes all so far it works correct. But all appointed dates remain in the database. So the are not deleted.

Can you please check this behaviour on your own systems?

Thanks and have a nice weekend
Sven
In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Hi Valery,

i found another bug, at least i think so.
If i have some time slots as a teacher and i try to delete a few of them selectively, i get the following error message:

FEHLER: ungültige Eingabesyntax für ganze Zahl: »«

SELECT * FROM mdl_scheduler_slots WHERE id = ''
  • line 677 of lib/dmllib.php: call to debugging()
  • line 474 of lib/dmllib.php: call to get_recordset_sql()
  • line 414 of lib/dmllib.php: call to get_record_sql()
  • line 365 of mod/scheduler/locallib.php: call to get_record()
  • line 383 of mod/scheduler/teacherview.controller.php: call to scheduler_delete_slot()
  • line 81 of mod/scheduler/teacherview.php: call to include()
  • line 116 of mod/scheduler/view.php: call to include()
Following is the link which has been called:

To me it seems like there are no items which can be passed to teacherview.controller.php as there is "$slotids = required_param('items', PARAM_RAW);" defined.

Can you reproduce this problem? For me it is not browser dependend, it happens with safari as with firefox.

Thanks again for your help, regards
Sven
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

I fear you are not completely up to date. §365 in locallib has no code in dev/last uploadable version. Current is 2008040900.

Last link at ethnoinformatique.fr on scheduler now points on the night build of contrib records from the CVS. Probably the most "up to date" code we could have, pursuant I have time to make commits !!

selective deletions work nice on dev implementation...

Cheers.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Sorry, but i think the error persists for me... sad
I checked out the latest version of scheduler from moodle CVS/Contrib but the error remains. It is not possible to delete selected time slots. Also if no slot is selected and i click "delete" an error occurs, as in the former version. Version.php says "2008040900".
Error message didn't change:

FEHLER: ungültige Eingabesyntax für ganze Zahl: »«

SELECT * FROM mdl_scheduler_slots WHERE id = ''
line 677 of lib/dmllib.php: call to debugging()
line 474 of lib/dmllib.php: call to get_recordset_sql()
line 414 of lib/dmllib.php: call to get_record_sql()
line 368 of mod/scheduler/locallib.php: call to get_record()
line 383 of mod/scheduler/teacherview.controller.php: call to scheduler_delete_slot()
line 81 of mod/scheduler/teacherview.php: call to include()
line 124 of mod/scheduler/view.php: call to include()


Regards,
Sven
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Sven, what could be checked is : when you select slots using checkboxes, do you see slot id list changing in status bar ? If not, this may be a Javascript related issue. I use Javascript to add or remove checked items from an id list. this is done by the /scripts/listlib.js file in the scheduler distribution. Tell me what is your client side configuration please, so we could attempt finding the cause. 

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Ok, it seems you are right.
I tried it with Safari on Mac OS X 10.5 and also with Firefox 3B5 on the same host.

Firebug says:

obj is null
toggleListState("", "sel_33", "33")listlib.js (line 75)
onclick(click clientX=219, clientY=188)view.php?id=19928 (line 1)
[Break on this error] if (obj.checked == 1){



In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -
I think my implementation is not solid enough regarding to Javascript namespaces. There are many difference in data and identifier isolation from a browser to another. I will have a look to lower collision risks that could avoid finding an object. 
In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
OK, thanks again for your fast response.

We'll wait for the fix... smile
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

Sven, try this :

on teacherview.php §599

replace :

            $selectcheck = "<input type=\"checkbox\" name=\"sel_{$slot->id}\" name=\"sel_{$slot->id}\" onclick=\"document.forms['deleteslotsform'].items.value = toggleListState(document.forms['deleteslotsform'].items.value, 'sel_{$slot->id}', '{$slot->id}');\" />";

with

            $selectcheck = "<input type=\"checkbox\" id=\"sel_{$slot->id}\" name=\"sel_{$slot->id}\" onclick=\"document.forms['deleteslotsform'].items.value = toggleListState(document.forms['deleteslotsform'].items.value, 'sel_{$slot->id}', '{$slot->id}');\" />";

This was a cut/copy error of mine.

Windows based IE merges id and name in one variable so getElementById find element on names and not Safari (more W3C compliant).

Maybe will we still have an error as name and id have same value, and Safari might not like it...

Cheers.

In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
Ok, i merged your change into our test scheduler installation. It resolves the javascript error, but not the"remove slot" error.

Clicking on "delete" still results in "Could not delete the slot from the database". And still, after "items" in the address bar there are no values. I think there should be the IDs of the slots which should be deleted, right?
In reply to Valery Fremaux

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Sven Laudel -
By the way, i tested it with IE7 now and the same error occurs.
In reply to Sven Laudel

Re: Scheduler module : calendar event issue resolved. 2008021600 published.

by Valery Fremaux -

I've been a very naughty boy : I didn't test by myself the patch I submitted to you rouge. Overconfidence is not a good behaviour when coding.

I'll check that straighter. I fear id<->name collision may be harmfull in some cases.