Copying labels from other courses

Copying labels from other courses

by Audun Hauge -
Number of replies: 2
I'm testing a script for editing layout and copying resources/mods from other courses. I've found the following problem:
When I copy in a label from another course, it dosn't show up (except for edit-icons in edit mode). Hiding and then showing it causes the label to be displayed as normal, also editing and saving will cause it to display. I'd of course like to have the labels displayed normally after copy, but I'm stumped. Does anyone know of a tweak to apply so that copied labels show up?

All other mods behave as expected after copy ... only  labels have this unadjacent behaviour.
Average of ratings: -
In reply to Audun Hauge

Re: Copying labels from other courses

by Jan Dierckx -
Audun,

Have you looked at the function rebuild_course_cache ?
It's in course/lib.php
Hope this helps...
In reply to Jan Dierckx

Re: Copying labels from other courses

by Audun Hauge -
Well, yes that helped. I assumed I'd picked out all neccessary changes made to course.modinfo . It turns out that labels use an extra value (called extra). Copying the name of the label into this field causes the label to show.
Thanks! smile