Moodle

Browse repository button doesn't appear on IMS resource

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8, 1.8.1
  • Fix Version/s: 1.8.2, 1.9
  • Component/s: IMS-CP resource type
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Setting $CFG->repositoryactivate = true; in the repository_config.php file does not display a "Browse repository" button in the mod form.

(Other reports here: http://moodle.org/mod/forum/discuss.php?d=31011#p320859)

Issue Links

Activity

Hide
Sean Keogh added a comment - - edited

I have this problem on two live sites. One is a new 1.8.1+ install on a Linux server, and the other an upgrade to 1.8.1+ from a 1.6.3+ windows-based site that was previously working OK with IMS Content Packages repository..

This is pretty important to my clients.

Sean K

Show
Sean Keogh added a comment - - edited I have this problem on two live sites. One is a new 1.8.1+ install on a Linux server, and the other an upgrade to 1.8.1+ from a 1.6.3+ windows-based site that was previously working OK with IMS Content Packages repository.. This is pretty important to my clients. Sean K
Hide
James Ballard added a comment - - edited

This seems to be caused by move to

$mform->

for creating menus in the resource.class.php

There is no rule for addding the repository button in the setup_elements function. The previous ims.html form is redundant - you can delete it with no impact on what you see.

I used the following to create the button in the setup_elements function:

if ($CFG->repositoryactivate == true) { $repositorybutton = $mform->addElement('button', 'repositorybutton', get_string('browserepository', 'resource').'...'); $buttonattributes = array('title'=>get_string('browserepository', 'resource'), 'onclick'=>"return window.open('".$CFG->wwwroot."/mod/resource/type/ims/finder.php?directory=', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');"); $repositorybutton->updateAttributes($buttonattributes); }

which seems to work, except hitting choose in the finder does not return any information to the form.

Show
James Ballard added a comment - - edited This seems to be caused by move to $mform-> for creating menus in the resource.class.php There is no rule for addding the repository button in the setup_elements function. The previous ims.html form is redundant - you can delete it with no impact on what you see. I used the following to create the button in the setup_elements function: if ($CFG->repositoryactivate == true) { $repositorybutton = $mform->addElement('button', 'repositorybutton', get_string('browserepository', 'resource').'...'); $buttonattributes = array('title'=>get_string('browserepository', 'resource'), 'onclick'=>"return window.open('".$CFG->wwwroot."/mod/resource/type/ims/finder.php?directory=', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');"); $repositorybutton->updateAttributes($buttonattributes); } which seems to work, except hitting choose in the finder does not return any information to the form.
Hide
Eloy Lafuente (stronk7) added a comment -

Now the "Browse Repository" is back (both under 18_STABLE, and HEAD).

Should be available in next nightly build (or by direct CVS access).

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Now the "Browse Repository" is back (both under 18_STABLE, and HEAD). Should be available in next nightly build (or by direct CVS access). Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

P.S.: Also, the unused ims.html file has been removed from >= 18_STABLE. Thanks James!

Show
Eloy Lafuente (stronk7) added a comment - P.S.: Also, the unused ims.html file has been removed from >= 18_STABLE. Thanks James!
Hide
Helen Foster added a comment -

Thanks Eloy, going to test it...

Show
Helen Foster added a comment - Thanks Eloy, going to test it...
Hide
James Ballard added a comment -

Thanks,

Working fine on my local test version - will push to live server soon and feedback, but can't see any reason for further issues.

I did notice that the previous version used to automatically fill in the resource title (and summary?), but doesn't do this anymore. Not sure if this is a desired feature or not.

Show
James Ballard added a comment - Thanks, Working fine on my local test version - will push to live server soon and feedback, but can't see any reason for further issues. I did notice that the previous version used to automatically fill in the resource title (and summary?), but doesn't do this anymore. Not sure if this is a desired feature or not.
Hide
Eloy Lafuente (stronk7) added a comment -

Uhm... not sure if that's a desired feature. Perhaps, title or summary are empty, yes, but if they contain any info I wouldn't replace it.

Are you sure it was present in old releases? I've take a quick look and haven't been able to locate such code when choosing ims packages (both from the course area and from the repository).

And finally, I guess it's really complex to do under new formslib. I'll imply to create one highly specialised form element (only used by ims cp) to provide such functionality...

So, after all, I would vote -1 for that.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Uhm... not sure if that's a desired feature. Perhaps, title or summary are empty, yes, but if they contain any info I wouldn't replace it. Are you sure it was present in old releases? I've take a quick look and haven't been able to locate such code when choosing ims packages (both from the course area and from the repository). And finally, I guess it's really complex to do under new formslib. I'll imply to create one highly specialised form element (only used by ims cp) to provide such functionality... So, after all, I would vote -1 for that. Ciao
Hide
James Ballard added a comment -

It used to work in 1.6 version, but is far from essential. If you get some spare time for a super button go for it , but I'm sure there are higher priority developments to get stuck into.

Thanks
James

Show
James Ballard added a comment - It used to work in 1.6 version, but is far from essential. If you get some spare time for a super button go for it , but I'm sure there are higher priority developments to get stuck into. Thanks James

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: