Discussions started by Joseph Rézeau

Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi

In the course of testing MDLQA-2048 for Moodle 2.3 I have come across an unexplainable bug.

Step 3. says "Complete the form by typing some text into every box, including an image in each box which has a text editor, such as the question text."

So I tried to include images, but the file picker keeps telling me that images (JPEG, GIF) are "not accepted". This problem is not restricted to questions editing, of course, I am getting the same bug when trying to insert images in any Moodle 2.3 activity.

Joseph

Attachment 26-05-2012 14-28-33.jpg
Average of ratings: Useful (1)
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi all PHP gurus!

I've just discovered that I was using a couple of deprecated PHP 5.3 functions in one of my plugins (viz. ereg() and split).

Deprecated: Function ereg() is deprecated in ... on line ...

However, I only get the error message in my moodle 2.3 installation, although I'm using the same deprecated functions on my moodle 2.1 and 2.2 test sites on the same box. Why is that?

I cannot find a setting which would trigger the (php) deprecated error message on 2.3 and not on previous versions, where the PHP version used is the same (same box), my debug settings are exactly the same, etc.

Any ideas?

Joseph

Average of ratings: -
Picture of Développeurs Picture of Développeurs de plugins Picture of Moodleurs particulièrement utiles Picture of Testeurs Picture of Traducteurs

Bonjour à tous les développeurs Moodle (et aux autres aussi). Nous avons eu récemment sur ce forum une discussion à propos des mérites relatifs de CVS et GIT.

En recherchant des infos à propos du fonctionnement de GIT (je suis toujours en phase d'apprentissage...) je suis tombé sur cette page, qui me propose l'original anglais et ... une traduction (automatique) en français. Je vous laisse apprécier.tongueoutevilthoughtful

Pour ceux qui voudraient connaitre l'origine du terme GIT employé par Linus Torvalds, voir ici. La traduction de GIT par "connard" fera peut-être sourire notre ami Valery qui n'aime pas beaucoup GIT.

Joseph

Attachment 27-03-2012 18-35-24.jpg
Average of ratings: Super cool ! (3)
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello,

Further to this docs page and this discussion, I am trying to replace a whole bunch of 'yes/no' dropdown lists with checkboxes in a block. I am surprised to find so few examples of using checkboxes in current core Moodle blocks.

Also, I have not found a single example showing how to store/retrieve a checkbox value to/from a block's config.

The only way I have managed to it get to work so far is as follows (using definition_after_data). Here is the edit_form of my test block:

class block_my_peers_edit_form extends block_edit_form {
    protected function specific_definition($mform) {       
        $mform->addElement('checkbox', 'config_mytest','','Check this box for the test');                
    }
    function definition_after_data(){
        $mform =& $this->_form;
        if(!$mform->getElementValue('config_mytest')){
            $this->block->config->mytest = 0;
        }
    }    
}

This does work, but is it the correct/best way of doing things? Are there drawbacks or alternative better ways? Why are there still so many instances of 'yes/no' dropboxes in Moodle core instead of the more ergonomic radiobuttons or checkboxes?

Joseph

Average of ratings: -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

I am reviewing a block which has a long list of yes/no settings. At the moment those settings are using dropdown lists, which is not terribly ergonomic. I want to replace the $mform->addElement('select'... elements with $mform->addElement('radio'... elements and I know how to do that.

I would also like to have each setting label followed by its ◊yes ◊no radio buttons horizontally arranged on the same line.

How I do that?

Joseph

Average of ratings: -