Moodle 1.5.1

Moodle 1.5.1

by Martin Dougiamas -
Number of replies: 45
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm back from Thailand and slowly getting organised again after nearly four weeks away. 

One thing I need to do soon is release Moodle 1.5.1 and also formally announce Moodle 1.5.x (which is something I never got around to doing with the original release in all the rush at the time  blush ).

I would like to do this within 12 hours, unless anyone knows any reason why I shouldn't.  Please let me know if you have any showstoppers.
Average of ratings: -
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Martín Langhoff -
G'day!

Only one bug I'm aware of affecting some of my code, and has a valid workaround. I'm getting on the plane in less than 24hs, and won't be able to fix it before I get to Europe. The problem has been reported here http://moodle.org/mod/forum/discuss.php?d=25828 but I'm not sure that the fix offered is good for the general situation.

I don't think it's a major issue -- it's a UI config issue affecting just CAS users, and people have found a workaround setting the values in the LDAP page. I'll try to take a look at it, but can't promise much. It's all a rush before the flight.

Haven't been tracking bugzilla much, just some key forums.
In reply to Martín Langhoff

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Hi!

1/ I would like to add some tweaks for relinking during restore, Eloy is reviewing a patch.

2/ There is a typo in auth/ldap/lib.php auth_user_activate(), semicolon after default and maybe missing break in the same switch statement.

3/ I need help with testing of security related patches.

skodak
In reply to Petr Skoda

Re: Moodle 1.5.1

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi,

Petr's code to improve backup/restore relinking seems to be working pretty well but I've performed initial tests only. (http://moodle.org/mod/forum/discuss.php?d=26530).

I would like to check it a bit more intensively (with one custom heavy-linked course I'm building) before submitting it to CVS (1-2 days, depending of my "legal" work! wink ).

Anyway, my vote goes to release 1.5.1 with or without such patch applied. The number of improvements since 1.5 are really huge and significant. So, from *my* list, no problem to go ahead.

Ciao smile

PD: I want to seized the opportunity to point developers to the list of 1.4 and 1.5 unmerged files. I think we should review and close 1.4 ASAP.

Edited: Uhm, curiously, the wiki page stops to show 1.5 unmerged files before ending. Perhaps a wiki-bug?
In reply to Eloy Lafuente (stronk7)

Re: Moodle 1.5.1

by N Hansen -
I've been very busy reporting bugs while you were away-I don't know if any of these can be fixed in 12 hours but these are the most serious bugs I have found that have yet to be fixed, that you might just want to take a quick look at:

bug 3515
bug 3528
bug 3564


In reply to Eloy Lafuente (stronk7)

Re: Moodle 1.5.1

by N Hansen -
A question about 1.5.1-Will it purge all those automatic backup records that inadvertantly were added to the logs with 1.5? It would be nice if they could be retroactively gotten rid of now that the problem is apparently fixed.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
How about a 1.5.1RC in 24hours from now and 1.5.1 final within next 48 hours?

I just got my coding mood back, I could fix quite a lot tonight + tomorrow...

Anyway I need a tester for auth/CAS really badly, I think the current code may not work. Please!!
In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
My TODO for 1.5.1 updated.

Critical:
  • fixing CAS - need testers !!!!

Minor:
  • lesson - check the use of format_text(), there should be no cleaning
  • alternate login url and new sessions - check if it works
In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I am ready for 1.5.1 big grin
There will be no more security fixes in this release.
In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
One more candidate for 1.5.1 here - not yet in CVS.

And we should also bump up version numbers of modules and its dependency on Moodle 1.5.1, because most of them would not work anyway and it also helps to detect incomplete==mixed installs.
In reply to Petr Skoda

Re: Moodle 1.5.1

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Brilliant, thanks for your work, Petr.  I'll try for later today then.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Gustav W Delius -
Oh, I have been busy and therefore only just noticed this discussion about Moodle 1.5.1. There are some things that need to be done in the quiz module still. I'll report back later.
In reply to Gustav W Delius

Re: Moodle 1.5.1

by Gustav W Delius -
There is still a bug in the quiz module code that allows new attempts to be based on previous attempts. I know the reason for the bug but will not have time to fix it until later today. Can Moodle 1.5.1 wait until tonight, UK time?
In reply to Gustav W Delius

Re: Moodle 1.5.1

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, sure, thanks, but this is the last one  smile 
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Another assignment related candidate (word count) - patch is here.

I will commit it in about 2 hours if nobody protest...
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Gustav W Delius -
Thanks. That bug in the quiz module is now fixed. There are still issues with backup/restore of user attempts and with the item analysis report plug-in but they will have to wait until 1.5.2
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Martin, please merge the languages too. A lot of work is done by the translators since 1.5
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
OK, we're very close now. I've merged all the languages and checked over some code and done a million other unrelated things wink. I was about to package it up when I remembered an occasional but really serious bug that has affected a few sites that have upgraded from 1.4.x to 1.5.x.

The bug is related to the Journal upgrade to Assignment (my code) ... in the three cases of this bug that I've seen now:
  1. The Journals are hidden (as expected)
  2. The new Online Assignment activities are created and can be seen on the Assignment index page (as expected)
  3. The new Online Assignment activities are not showing up in the main course page (big problem).
(3) has worked for me fine on some servers, so I'm not sure why it didn't in these cases. I have started to set up a 1.4 test server to test this part of the upgrade, but I really should get some sleep right now so I'll delay this (and the release) until tomorrow.

Help wanted!

  1. If others could test this journal->assignment upgrade thoroughly during the next 6 or 7 hours that would be terrific and really save me some time tomorrow!

  2. We also need to generate release notes for 1.5.1 ... Martin Langhoff and Penny have been helping with point release notes recently but they're away in Helsinki currently ... any volunteers for this too? The best way is to look through the CHANGES, and summarize stuff here on this Wiki page.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
got one more to fix here:
MySQL logical operator '&&' is not allowed in Postgresql sad
have to install postresql first in my Suse box though...

Do you have any sample 1.4x db dump with those problems? Could you send it to me?
In reply to Petr Skoda

Re: Moodle 1.5.1

by Worth Bishop -

Forgive me for butting in here - but I'm the PostgreSQL user whose plea for help Petr linked to above. Stumbled into this forum purely by accident...

I have a development box running PostgreSQL 7.4.5 as well as my production box running 7.4. Can I be of any help in testing?

Thanks,

Worth

In reply to Worth Bishop

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Here is the patch, did not have enough energy to properly test & commit it, going to bed:
Index: lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/assignment/lib.php,v
retrieving revision 1.118.2.5
diff -u -r1.118.2.5 lib.php
--- lib.php	5 Jul 2005 06:28:53 -0000	1.118.2.5
+++ lib.php	7 Jul 2005 21:43:14 -0000
@@ -757,7 +757,7 @@
         }
 
 
-        $select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture, s.id AS submissionid, s.grade, s.comment, s.timemodified, s.timemarked, ((s.timemarked > 0) && (s.timemarked >= s.timemodified)) AS status ';
+        $select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture, s.id AS submissionid, s.grade, s.comment, s.timemodified, s.timemarked, ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
         $sql = 'FROM '.$CFG->prefix.'user u '.
                'LEFT JOIN '.$CFG->prefix.'assignment_submissions s ON u.id = s.userid AND s.assignment = '.$this->assignment->id.' '.
                'WHERE '.$where.'u.id IN ('.implode(',', array_keys($users)).') ';

To Martín: could you please test/commit it?
In reply to Petr Skoda

Re: Moodle 1.5.1

by Worth Bishop -

This change allowed me to view submitted assignments without throwing the error. Success.

However - while working through this process and testing, I tried to modify some of the existing assignments. Each attempt yielded the following error:

ERROR: invalid input syntax for integer: ""

UPDATE mdl_assignment SET course = '9', name = 'Assignment One', description = 'Assignment decription', format = '1', assignmenttype = 'offline', resubmit = '', preventlate = '0', emailteachers = '', var1 = '', var2 = '', var3 = '', var4 = '', var5 = '', maxbytes = '5242880', timedue = '1286979300', timeavailable = '0', grade = '', timemodified = '1120780256' WHERE id = '4'

Could not update the assignment

This error was the same regardless of whether the code above was "&&" or "AND" so it looks to be unrelated.

I could create a new assignment, but got the same error if I tried to modify it after submitting it.

I'm bailing now, but will have a few hours in the morning (~12 hours from now - I'm in US Eastern time zone) and would like to help.  After about 14:00 EDT tomorrow, I'll be out-of-pocket for much of the following week.

Thanks, Petr, and I hope this helps.

In reply to Worth Bishop

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I am not PostgreSQL expert you know, but I think I have seen something about this problem somewhere - another MySQL "nonstandard" feature I guess sad

I will work on it today.
Thanks for testing & reporting...
In reply to Petr Skoda

Re: Moodle 1.5.1

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I've committed this (it LOOKS right), but I can't test it as I don't have PG.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I confirm "Cannot update assignment" as a show stopper for PostgreSQL sites.

Working on it - it will take me some time, I am sure the NZ team would fix it in seconds sad
In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I got it!!! It is the function s() that is PostgreSQL unfriendly.

function s($var) {

if (empty($var)) {
return '';
}
return htmlSpecialChars(stripslashes_safe($var));
}

If you send number 0, it prints it as '', it causes a major trouble if you use it in forms - see the discussion here.

dirty quick fix:
if ($var === 0 || $var === '0') {
return '0';
} else if ($var == '')) {
return '';
}

any better ideas?

The use of empty here is encouraging bad coding style, would it break anything, maybe keep it here for 1.5.1 and remove in 1.6?

In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
here is the patch, IMO the isset should be removed because it should throw a warning if $var is not initialized, I am waiting for Martin's approval...

Index: weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.469.2.13
diff -u -r1.469.2.13 weblib.php --- weblib.php 6 Jul 2005 06:54:58 -0000 1.469.2.13 +++ weblib.php 8 Jul 2005 12:48:36 -0000 @@ -98,9 +98,11 @@ * @return string */ function s($var) { - - if (empty($var)) { - return ''; + if (!isset($var)) { // TODO: temporary hack to make it more + return ''; // compatible with 1.5, removed in 1.6 + } + if ($var == '0') { // for integer 0, boolean false, string '0' + return '0'; } return htmlSpecialChars(stripslashes_safe($var)); } @@ -115,9 +117,11 @@ * @return string */ function p($var) { - - if (empty($var)) { - echo ''; + if (!isset($var)) { // TODO: temporary hack to make it more + echo ''; // compatible with 1.5, removed in 1.6 + } + if ($var == '0') { // for integer 0, boolean false, string '0' + echo '0'; } echo htmlSpecialChars(stripslashes_safe($var)); }

In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
It is funny, assignments work ok with my previous patch, but it breaks forum posting - not good.

edit: I did not think much about p() - I just copied the bug from the old code to my new one :-\
Index: weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.469.2.13
diff -u -r1.469.2.13 weblib.php --- weblib.php 6 Jul 2005 06:54:58 -0000 1.469.2.13 +++ weblib.php 8 Jul 2005 13:40:11 -0000 @@ -98,9 +98,11 @@ * @return string */ function s($var) { - - if (empty($var)) { - return ''; + if (!isset($var)) { // TODO: temporary hack to make it more + return ''; // compatible with 1.5, removed in 1.6 + } + if ($var == '0') { // for integer 0, boolean false, string '0' + return '0'; } return htmlSpecialChars(stripslashes_safe($var)); } @@ -115,11 +117,11 @@ * @return string */ function p($var) { - - if (empty($var)) { - echo ''; + if ($var == '0') { // for integer 0, boolean false, string '0' + echo '0'; + } else { + echo htmlSpecialChars(stripslashes_safe($var)); } - echo htmlSpecialChars(stripslashes_safe($var)); }

In reply to Petr Skoda

Re: Moodle 1.5.1

by Worth Bishop -

Ok, Petr, I have this in weblib.php:

function s($var){ 

    if (!isset ($var)) { // TODO: temporary hack to make it more 
       return '';        //       compatible with 1.5, removed in 1.6 
    } 
    if ($var == '0') {   // for interger 0, boolean false, string '0' 
        return '0'; 
    } 
    return htmlSpecialChars(stripslashes_safe($var)); 

 
/**
* Add quotes to HTML characters...
* ...@return
string 
*/

function p($var) { 
  
    if ($var == '0') {     // for integer 0, boolean false, string '0'
        echo '0'; 
    } else {
        echo htmlSpecialChars(stripslashes_safe($var));
    }
}

I try an update to a course and again get:   ERROR: invalid input syntax for integer: ""

Have I flubbed it?

Thanks,

Worth

In reply to Worth Bishop

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Well, there are still other bugs, but it should not be problem to fix those too big grin
Wait a minute...

edit: logical bug with resubmit, need more time to think about it...

Index: mod.html
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/assignment/mod.html,v
retrieving revision 1.36
diff -u -r1.36 mod.html
--- mod.html	19 May 2005 14:13:21 -0000	1.36
+++ mod.html	8 Jul 2005 14:29:06 -0000
@@ -13,9 +13,6 @@
     if (empty($form->assignmenttype)) {
         $form->assignmenttype = "uploadsingle";
     }
-    if (empty($form->resubmit)) {
-        $form->resubmit = "";
-    }
     if (!isset($form->grade)) {
         $form->grade = 100;
     }

In reply to Petr Skoda

Re: Moodle 1.5.1

by Ger Tielemans -
        // cleanup bad html that may have made it to the db
        $value = clean_text($value);
This code was stripped from /lib/weblib.php ....That's correct?
In reply to Ger Tielemans

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Sure, correct - because this prevented correct operation of Resources, Books and in fact did not help security much.

If there is any place that would be compromised by this, please report it - but the correct solution is to clean the text before feeding to editor, not here. There was one such place, but I have fixed it at the same time. Anyway it was added quite recently, so I assume that it did not create any problems...
In reply to Petr Skoda

Re: Moodle 1.5.1

by Worth Bishop -

Just confirming:

With 3 changes above re:  weblib.php (2) and mod.html, the assignments are updating cheerfully...

Thanks!

Worth

Average of ratings: Useful (1)
In reply to Petr Skoda

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I have reviewed all places that use function s(), it is 99.9% safe to commit it without the isset() hack. I have tested assignments in both MySQL and PostgreSQL, so the other patch with "resubmit" is also 99.9% safe.

I did not commit them, waiting for Martin's decision...
In reply to Petr Skoda

Re: Moodle 1.5.1

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Please check them in!   approve

How did this escape testing for two months?  Was no-one using PostgreSQL using assignments?  sad
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
It is in CVS, but after 1.5.1 tagging, so it is in fact 1.5.1+
(files lib/weblib.php and mod/assignment/mod.html)

In any case, I am continuing my work on 1.5.x branch for several days. Because IMO there are still some serious bugs left in 1.5.1 if we do not intend to make 1.6 stable before the start of semester in September.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Martín Langhoff -
Unfortunately, spot on: none of the installs I maintain or know about (and those are on PG) makes extensive use of assignment. sad

Damn blind spot...
In reply to Martín Langhoff

Re: Moodle 1.5.1

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I am just strugling through the assignment bugtracker - most of the problems were reported - some even with solution sad
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Sonia Pestana -

Hey, Martin!

I have use Moodle (Moodle 1.5.1 (2005060210)) with PG and I can report some bugs. For example:

(...)I have also a problem with the Assignment module after this installation. Some strange... see http://moodle.org/mod/forum/discuss.php?d=27513 (...)

But nobody give me a response...perplexo

In reply to Martin Dougiamas

Re: Moodle 1.5.1

by John Papaioannou -
Update:

Bug 3637 (really bad, though not many people experience it) is under investigation, we 're waiting for feedback from the reporter. May be solved really really soon.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Melissa Fernandez -
I'm not sure if this is the correct place to post this but since it is an issue that atleast a few others have had i felt it atleast worth noting.  When using the UTF8 character set with MySQL Version 4.1 and PHP Version 4.3.10 an attempt at upgrading from Moodle 1.4 to Moodle 1.5 gives you the following error.

Error Message: 1071: Specified key was too long. Max key length is 1000

The error occurs when creating the mdl_config_plugins table.

I apologize if this has been dealt with but searches turned up nothing other then recreating the database under a different character set.
In reply to Melissa Fernandez

Re: Moodle 1.5.1

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Well, that's weird because we don't have a key over 1000 characters in that table ... I guess UTF blows it out somehow.   I'll shorten the varchars from 250 to 100 characters.
In reply to Martin Dougiamas

Re: Moodle 1.5.1

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Martin,

As stronk7 noted, each varchar when using the UTF character set takes up three characters so you have to take that 1000 and divide it by 3 for the actual limit. So any index over 333 well cause the index error. Since the index is composed of 2 varchar (250) fields if you shorten those to varchar (150) it should work fine.

Peace - Anthony