Skip to content

Conversation

@bradenmacdonald
Copy link
Member

Hotfix for OC-639:

Bug details:
The old mentoring XBlock uses South migrations to create a table called mentoring_answers. The new Problem Builder XBlock uses syncdb to create a table also called mentoring_answers.

Unfortunately, if a new edX instance is spun up and mentoring v1 and Problem Builder are both being installed at the same time (as they are if requirements/edx/edx-private.txt is used), there will be a database error since the South migration will abort when it finds that the table already exists: https://gist.github.com/maxrothman/3868d5e7ad87533a287c

Because syncdb does nothing if the table already exists, an edX instance could only have both blocks installed as long as mentoring was installed and setup in the DB first.

Fix details:
My proposed fix is just to rename the table in Problem Builder. I've also added a data migration that copies all student answers from the mentoring_answers table to the new table, which should prevent any students who may be currently using problem builder from losing data.

Consequences:

  • Running the upgrade script that converts from the old block to the new one will no longer automagically migrate any student answers made since problem builder was installed. However, I don't really want anyone attempting to do that upgrade on a course that students are using anyways.

Recovery:
If someone encountered the error seen in the gist link above, it should be possible to recover with:

./manage.py lms migrate mentoring 0003 --fake --settings=devstack

(Change devstack to whatever configuration is being used)

@antoviaque
Copy link
Member

👍

@bradenmacdonald Thanks for taking on this fix!

@sarina
Copy link

sarina commented Apr 24, 2015

👍

bradenmacdonald added a commit that referenced this pull request Apr 24, 2015
Hotfix for OC-639: Database conflict between mentoring and problem_builder
@bradenmacdonald bradenmacdonald merged commit d7ab348 into edx-release Apr 24, 2015
@bradenmacdonald bradenmacdonald deleted the hotfix-oc-639 branch April 24, 2015 15:52
@bradenmacdonald bradenmacdonald mentioned this pull request Apr 24, 2015
eliangcs added a commit to eliangcs/xblock-utils that referenced this pull request Aug 14, 2016
This is to fix open-craft/problem-builder#18, where a button marked with
'single-instance' data got disabled, hence its click event handler at
edx-platform is not called.

This patch solves this issue by correcting the calling order, so that we
invoke the click event handler at edx-platform first; then we disable
the button.
eliangcs added a commit to eliangcs/xblock-utils that referenced this pull request Sep 8, 2016
This is to fix open-craft/problem-builder#18, where a button marked with
'single-instance' data got disabled, hence its click event handler at
edx-platform is not called.

This patch solves this issue by correcting the calling order, so that we
invoke the click event handler at edx-platform first; then we disable
the button.
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.

4 participants