Moodle

When restoring database , links are not recoded

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.2, 1.8.2, 1.9
  • Fix Version/s: 1.7.3, 1.8.3, 1.9
  • Labels:
    None
  • Environment:
    Moodle 1.7.2, Apavhe 2.0, php 5, Linux
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

On backup, a link like http://MYSERVER.fr/moodle/mod/resource/view.php?id=831 in the description field
of a database activity is changed to $@RESOURCEVIEWBYID*831@$ in the backup file.

On restore, this is then supposed to be changed back, but using the new id.

This was not being done for a database activity either by backup/restore nor by using the new importation option.

This relates to http://tracker.moodle.org/browse/MDL-9432 where that bug was also reported for quizzes.

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Wow.

confirmed. Just discovered that the data module hasn't support for encoding and decoding of links at all!

It should have:

1) In backuplib.php:

data_encode_content_links to convert links to data modules to the transportable form. At least support for this should be provided: DATAINDEX, DATAVIEWBYID, DATAVIEWBYD, DATAELEMENTVIEW (forum can be a good reference)

2) In restorelib.php:

data_decode_content_links: To convert the transportable links generated above to their normal appearance, using new ids in the restored course. Must be able to decode all the links above.

data_decode_content_links_caller: The function that selects the contents to be processed in the module and pass them to the restore_decode_content_links_worker (central) function. This function has the responsibility to write decoded contents back to DB.

Martin, if HQ has time, it would be great. Else, just drop one comment here and I'll start it tomorrow.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Wow. confirmed. Just discovered that the data module hasn't support for encoding and decoding of links at all! It should have: 1) In backuplib.php: data_encode_content_links to convert links to data modules to the transportable form. At least support for this should be provided: DATAINDEX, DATAVIEWBYID, DATAVIEWBYD, DATAELEMENTVIEW (forum can be a good reference) 2) In restorelib.php: data_decode_content_links: To convert the transportable links generated above to their normal appearance, using new ids in the restored course. Must be able to decode all the links above. data_decode_content_links_caller: The function that selects the contents to be processed in the module and pass them to the restore_decode_content_links_worker (central) function. This function has the responsibility to write decoded contents back to DB. Martin, if HQ has time, it would be great. Else, just drop one comment here and I'll start it tomorrow. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Raising it to Major and adding some versions... to fix.

Show
Eloy Lafuente (stronk7) added a comment - Raising it to Major and adding some versions... to fix.
Hide
Petr Škoda (skodak) added a comment -

my +1

Show
Petr Škoda (skodak) added a comment - my +1
Hide
Eloy Lafuente (stronk7) added a comment -

Done, now interlinking from/to data module is working in 17_STABLE, 18_STABLE and HEAD.

Closing. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Done, now interlinking from/to data module is working in 17_STABLE, 18_STABLE and HEAD. Closing. Ciao

People

Vote (0)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: