Visual Arts Press Blog

The all knowing, ever present VAP knowledge base

Archive for April, 2013

Restoring CE course categories manually

with 3 comments

If all CE courses should be deleted from RegBook and hence, wiped off the site, then once they are restored into RegBook, reimport them into Symfony:

> ./symfony sva:ingest-regbook-import



While this will reimport all courses, unfortunately it will not reassign courses to their proper categories (course_category_map table will be empty).  These will have to be restored by hand (a db restore will not work because all page_ids and foreign keys will be different after the import).

Restoring Course Categories

  1. Drop sva db on beta and replace with sva db from production
  2. Open up two browser windows side by side: beta.sva.edu/cms.php and sva.edu/cms.php
  3. Navigate to CE > Course Categories on both browsers > select a concentration > select a category > click Show All Courses
  4. Open up a JavaScript console on both browsers
  5. In the beta console, paste the following:
    var str='';
    $('input:checked').each(function(){
    if(typeof $(this).val() != 'undefined') str+=$(this).val()+','});
    str=str.substr(0,str.length-1);
    str;
  6. Copy the output, including the open and closed quotes
  7. In the production window console, paste the following:
    var str=<paste the output from beta here>
    var arr=str.split(',');
    for(var i=0; i<arr.length; i++){$('input[value=' + arr[i] +']').prop('checked',true)}
  8. Save Changes
  9. Repeat for all categories (and UG courses). ┬áDon’t forget to click Show All Courses each time.

Written by ecorriel

April 2nd, 2013 at 10:11 pm

Posted in admin,web