Issue Details (XML | Word | Printable)

Key: MDL-20915
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Petr Škoda (skodak)
Reporter: Daniele Cordella
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

popup_form function is not 100% correct

Created: 20/Nov/09 03:12 PM   Updated: 19/Dec/09 05:05 AM
Component/s: Files API
Affects Version/s: 1.9.6
Fix Version/s: None

File Attachments: 1. Text File weblib.patch (0.9 kB)


Participants: Daniele Cordella and Petr Škoda (skodak)
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
As I quickly described in http://moodle.org/mod/forum/discuss.php?d=138323
I feel the function popup_form is not working 100% fine.
Let me explain.

In the frame of the development of the module "newmodule",
write the following code:

$url = $CFG->wwwroot.'/mod/newmodule/view.php?id='.$cm->id; // where $cm is what you think it is
$items = array();
$items[] = 'aa';
$items[] = 'bb';
popup_form($url, $items, 'myformid', '', get_string('choose'), 'myhelpfile', 'myhelptext', false);

The output of this code will be a popup_form equipped with an help button.
The helpbutton is supposed to link the file "myhelpfile.html" stored into $CFG->wwwroot.'/mod/newmodule/lang/xx_utf8/help/newmodule/
The link to that file shoulb be:
$CFG->wwwroot/help.php?module=newmodule&file=issuedays.html&forcelang=
but it is
$CFG->wwwroot/help.php?module=moodle&file=issuedays.html&forcelang=

Whether what I wrote is true, this function can't be used in this way in the frame of the development of a module!!!!



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Daniele Cordella added a comment - 11/Dec/09 05:55 AM
As far as I can understand the attached patch fixes the problem

Daniele Cordella added a comment - 19/Dec/09 05:05 AM
ok, Eloy, finally I arrived to detect it in even Moodle 2.0.
Infact, the bug exists in Moodle 2.0 too.
If you use the deprecated function popup_form (from /moodle20/lib/deprecatedlib.php) the problem is exactly the same described for moodle 1.9.
If you use the new syntax: $select->set_help_icon($page, $text, $linktext=false); the error doesn't change because the
class moodle_help_icon extends labelled_html_component {
defined in
moodle20/lib/outputcomponents.php
still hard code the value of the public variable $module to 'moodle';

Eloy, do I deserve the commit now? :-P
Ciao my friends.