Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #93: Add support for customfield backup/restore #119

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

jaypha
Copy link
Contributor

@jaypha jaypha commented Dec 13, 2023

Resolves #93

@jaypha jaypha force-pushed the 93-backup-restore branch 2 times, most recently from 63850ba to 0e78958 Compare December 13, 2023 04:39
*
* @param int $instanceid id of the instance or 0 if the instance is being created
* @return \context
*/
public function get_instance_context(int $instanceid = 0): \context {
return $this->get_configuration_context();
$modinfo = get_coursemodule_from_instance('cms', $instanceid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens here if $instanceid = 0 does it fail/explode? Or is the understanding that $instanceid can never be 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's never zero.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put in a extra check, just in case.

@Fragonite
Copy link

Just a reminder this needs another look.

Cheers.

@jaypha
Copy link
Contributor Author

jaypha commented Mar 13, 2024

I just did a check and everything still works. OK to have reviewed and merged.

@Fragonite
Copy link

Hi @jaypha any further updates on this? Would you like me to review?

Cheers.

@jaypha jaypha force-pushed the 93-backup-restore branch 2 times, most recently from 0ea4aeb to 4cc8e25 Compare March 19, 2024 04:34
@jaypha
Copy link
Contributor Author

jaypha commented Mar 19, 2024

Hi @jaypha any further updates on this? Would you like me to review?

Cheers.

Yeah. Sure. It is ready now. Unit tests have been implemented for fields and userlist, which use custom fields.

Copy link

@Fragonite Fragonite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests pass, manual testing works, changes look fine to me. Approving.

@marcusboon marcusboon merged commit 6afcda1 into main Mar 25, 2024
18 checks passed
@marcusboon marcusboon deleted the 93-backup-restore branch March 25, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for MDL-79151 annotations within custom fields are not backed up or restored
3 participants