Commit d0c77cef authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4980: updating logo names and using DB to do node update cause for...

ISTWCMS-4980: updating logo names and using DB to do node update cause for some reason node_save was messing up the actual node
parent 57395e01
......@@ -317,16 +317,13 @@ function uw_virtual_site_homepage_update_7104() {
foreach ($nodes as $node) {
if (isset($node->field_uw_faculty_list_logo) && !empty($node->field_uw_faculty_list_logo)) {
$node->field_uw_faculty_list_logo = [
'und' => [
'0' => [
'value' => _uw_virtual_site_homepage_get_logo_name($node->field_uw_faculty_list_logo['und'][0]['value']),
],
],
];
node_save($node);
db_update('field_data_field_uw_faculty_list_logo')
->fields(array(
'field_uw_faculty_list_logo_value' => _uw_virtual_site_homepage_get_logo_name($node->field_uw_faculty_list_logo['und'][0]['value'], TRUE),
))
->condition('entity_id', $node->nid)
->execute();
}
}
}
......@@ -345,57 +342,57 @@ function _uw_virtual_site_homepage_get_logo_name($logo_key = NULL, $with_nids =
// The array that stores all the old information about the logos.
$logos = array(
'UWaterloo_logo' => $with_nids ? 356 : 'University of Waterloo',
'UWaterloo_Applied_Health_Sciences' => $with_nids ? 366 : 'Applied Health Sciences',
'UWaterloo_Applied_Health_Sciences_Kinesiology' => $with_nids ? 320 : 'Applied Health Sciences - Kinesiology',
'UWaterloo_Applied_Health_Sciences_PublicHealth' => $with_nids ? 319 : 'Applied Health Sciences - Public Health',
'UWaterloo_Applied_Health_Sciences_Recreation_Lesiure' => $with_nids ? 321 : 'Applied Health Sciences - Recreation and Leisure Studies',
'UWaterloo_Arts' => $with_nids ? 365 : 'Arts',
'UWaterloo_Arts_Anthropology' => $with_nids ? 322 : 'Arts - Anthropology',
'UWaterloo_Arts_Classical_Studies' => $with_nids ? 323 : 'Arts - Classical Studies',
'UWaterloo_Arts_Communication_Arts' => $with_nids ? 324 : 'Arts - Communication_Arts',
'UWaterloo_Arts_Economics' => $with_nids ? 325 : 'Arts - Economics',
'UWaterloo_Arts_English_Language_Literature' => $with_nids ? 326 : 'Arts - English Language Literature',
'UWaterloo_Arts_FineArts' => $with_nids ? 327 : 'Arts - Fine Arts',
'UWaterloo_Arts_French' => $with_nids ? 328 : 'Arts - French',
'UWaterloo_Arts_Germanic_Slavic_Studies' => $with_nids ? 330 : 'Arts - Germanic Slavic Studies',
'UWaterloo_Arts_History' => $with_nids ? 331 : 'Arts - History',
'UWaterloo_Arts_Philosophy' => $with_nids ? 344 : 'Arts - Philosophy',
'UWaterloo_Arts_Political_Science' => $with_nids ? 345 : 'Arts - Political Science',
'UWaterloo_Arts_Psychology' => $with_nids ? 346 : 'Arts - Psychology',
'UWaterloo_Arts_Religious_Studies' => $with_nids ? 348 : 'Arts - Religious Studies',
'UWaterloo_Arts_School_of_Accounting_and_Finance' => $with_nids ? 378 : 'Arts - School of Accounting and Finance',
'UWaterloo_Arts_Sociology_and_Legal_Studies' => $with_nids ? 354 : 'Arts - Sociology and Legal Studies',
'UWaterloo_Arts_Spanish_and_Latin_American_Studies' => $with_nids ? 355 : 'Arts - Spanish and Latin American Studies',
'UWaterloo_Engineering' => $with_nids ? 368 : 'Engineering',
'UWaterloo_Engineering_wordmark' => $with_nids ? 360 : 'Engineering wordmark',
'UWaterloo_Engineering_Architecture' => $with_nids ? 377 : 'Engineering - Architecture',
'UWaterloo_Engineering_Chemical_Engineering' => $with_nids ? 334 : 'Engineering - Chemical Engineering',
'UWaterloo_Engineering_Civil_Environmental_Engineering' => $with_nids ? 336 : 'Engineering - Civil Environmental Engineering',
'UWaterloo_Engineering_Electrical_Computer_Engineering' => $with_nids ? 340 : 'Engineering - Electrical Computer Engineering',
'UWaterloo_Engineering_Management_Sciences' => $with_nids ? 342 : 'Engineering - Management Sciences',
'UWaterloo_Engineering_Mechanical_Engineering' => $with_nids ? 343 : 'Engineering - Mechanical Engineering',
'UWaterloo_Engineering_Systems_Design_Engineering' => $with_nids ? 358 : 'Engineering - Systems Design Engineering',
'UWaterloo_Environment' => $with_nids ? 367 : 'Environment',
'UWaterloo_Environment_50th_Anniversary' => $with_nids ? 403 : 'Environment - 50th Anniversary',
'UWaterloo_Environment_Environment_Enterprise_Development' => $with_nids ? 376 : 'Environment - Environment Enterprise Development',
'UWaterloo_Environment_Enviromental_Resources_and_Sustainability' => $with_nids ? 375 : 'Environment - Enviromental Resources and Sustainability',
'UWaterloo_Environment_Geography_Environmental_and_Management' => $with_nids ? 329 : 'Environment - Geography Environmental and Management',
'UWaterloo_Environment_Knowledge_Intergration' => $with_nids ? 341 : 'Environment - Knowledge Intergration',
'UWaterloo_Environment_Planning' => $with_nids ? 372 : 'Environment - Planning',
'UWaterloo_Mathematics' => $with_nids ? 369 : 'Mathematics',
'UWaterloo_Math_Applied_Math' => $with_nids ? 332 : 'Mathematics - Applied Math',
'UWaterloo_Math_Combinatorics_and_Optimization' => $with_nids ? 338 : 'Mathematics - Combinatorics and Optimization',
'UWaterloo_Math_Computer_Science' => $with_nids ? 379 : 'Mathematics - Computer Science',
'UWaterloo_Math_Pure_Math' => $with_nids ? 347 : 'Mathematics - Pure Math',
'UWaterloo_Math_Statistics_Actuarial_Science' => $with_nids ? 357 : 'Mathematics - Statistics Actuarial Science',
'UWaterloo_Science' => $with_nids ? 370 : 'Science',
'UWaterloo_Science_Biology' => $with_nids ? 333 : 'Science - Biology',
'UWaterloo_Science_Chemistry' => $with_nids ? 335 : 'Science - Chemistry',
'UWaterloo_Science_Earth_and_Environmental_Science' => $with_nids ? 339 : 'Science - Earth and Environmental Science',
'UWaterloo_Science_Optometry_and_Vision_Science' => $with_nids ? 374 : 'Science - Optometry and Vision Science',
'UWaterloo_Sciecne_Pharmacy' => $with_nids ? 373 : 'Science - Pharmacy',
'UWaterloo_Science_Physics_and_Astronomy' => $with_nids ? 402 : 'Science - Physics and Astronomy',
'logo' => $with_nids ? 356 : 'University of Waterloo',
'Applied_Health_Sciences' => $with_nids ? 366 : 'Applied Health Sciences',
'Applied_Health_Sciences_Kinesiology' => $with_nids ? 320 : 'Applied Health Sciences - Kinesiology',
'Applied_Health_Sciences_PublicHealth' => $with_nids ? 319 : 'Applied Health Sciences - Public Health',
'Applied_Health_Sciences_Recreation_Lesiure' => $with_nids ? 321 : 'Applied Health Sciences - Recreation and Leisure Studies',
'Arts' => $with_nids ? 365 : 'Arts',
'Arts_Anthropology' => $with_nids ? 322 : 'Arts - Anthropology',
'Arts_Classical_Studies' => $with_nids ? 323 : 'Arts - Classical Studies',
'Arts_Communication_Arts' => $with_nids ? 324 : 'Arts - Communication_Arts',
'Arts_Economics' => $with_nids ? 325 : 'Arts - Economics',
'Arts_English_Language_Literature' => $with_nids ? 326 : 'Arts - English Language Literature',
'Arts_FineArts' => $with_nids ? 327 : 'Arts - Fine Arts',
'Arts_French' => $with_nids ? 328 : 'Arts - French',
'Arts_Germanic_Slavic_Studies' => $with_nids ? 330 : 'Arts - Germanic Slavic Studies',
'Arts_History' => $with_nids ? 331 : 'Arts - History',
'Arts_Philosophy' => $with_nids ? 344 : 'Arts - Philosophy',
'Arts_Political_Science' => $with_nids ? 345 : 'Arts - Political Science',
'Arts_Psychology' => $with_nids ? 346 : 'Arts - Psychology',
'Arts_Religious_Studies' => $with_nids ? 348 : 'Arts - Religious Studies',
'Arts_School_of_Accounting_and_Finance' => $with_nids ? 378 : 'Arts - School of Accounting and Finance',
'Arts_Sociology_and_Legal_Studies' => $with_nids ? 354 : 'Arts - Sociology and Legal Studies',
'Arts_Spanish_and_Latin_American_Studies' => $with_nids ? 355 : 'Arts - Spanish and Latin American Studies',
'Engineering' => $with_nids ? 368 : 'Engineering',
'Engineering_wordmark' => $with_nids ? 360 : 'Engineering wordmark',
'Engineering_Architecture' => $with_nids ? 377 : 'Engineering - Architecture',
'Engineering_Chemical_Engineering' => $with_nids ? 334 : 'Engineering - Chemical Engineering',
'Engineering_Civil_Environmental_Engineering' => $with_nids ? 336 : 'Engineering - Civil Environmental Engineering',
'Engineering_Electrical_Computer_Engineering' => $with_nids ? 340 : 'Engineering - Electrical Computer Engineering',
'Engineering_Management_Sciences' => $with_nids ? 342 : 'Engineering - Management Sciences',
'Engineering_Mechanical_Engineering' => $with_nids ? 343 : 'Engineering - Mechanical Engineering',
'Engineering_Systems_Design_Engineering' => $with_nids ? 358 : 'Engineering - Systems Design Engineering',
'Environment' => $with_nids ? 367 : 'Environment',
'Environment_50th_Anniversary' => $with_nids ? 403 : 'Environment - 50th Anniversary',
'Environment_Environment_Enterprise_Development' => $with_nids ? 376 : 'Environment - Environment Enterprise Development',
'Environment_Enviromental_Resources_and_Sustainability' => $with_nids ? 375 : 'Environment - Enviromental Resources and Sustainability',
'Environment_Geography_Environmental_and_Management' => $with_nids ? 329 : 'Environment - Geography Environmental and Management',
'Environment_Knowledge_Intergration' => $with_nids ? 341 : 'Environment - Knowledge Intergration',
'Environment_Planning' => $with_nids ? 372 : 'Environment - Planning',
'Mathematics' => $with_nids ? 369 : 'Mathematics',
'Math_Applied_Math' => $with_nids ? 332 : 'Mathematics - Applied Math',
'Math_Combinatorics_and_Optimization' => $with_nids ? 338 : 'Mathematics - Combinatorics and Optimization',
'Math_Computer_Science' => $with_nids ? 379 : 'Mathematics - Computer Science',
'Math_Pure_Math' => $with_nids ? 347 : 'Mathematics - Pure Math',
'Math_Statistics_Actuarial_Science' => $with_nids ? 357 : 'Mathematics - Statistics Actuarial Science',
'Science' => $with_nids ? 370 : 'Science',
'Science_Biology' => $with_nids ? 333 : 'Science - Biology',
'Science_Chemistry' => $with_nids ? 335 : 'Science - Chemistry',
'Science_Earth_and_Environmental_Science' => $with_nids ? 339 : 'Science - Earth and Environmental Science',
'Science_Optometry_and_Vision_Science' => $with_nids ? 374 : 'Science - Optometry and Vision Science',
'Sciecne_Pharmacy' => $with_nids ? 373 : 'Science - Pharmacy',
'Science_Physics_and_Astronomy' => $with_nids ? 402 : 'Science - Physics and Astronomy',
'conrad_grebel' => $with_nids ? 389 : 'Conrad Grebel',
'renison_university_college' => $with_nids ? 391 : 'Renison University College',
'st_jeromes_university' => $with_nids ? 392 : 'St. Jerome\'s University',
......@@ -410,8 +407,8 @@ function _uw_virtual_site_homepage_get_logo_name($logo_key = NULL, $with_nids =
'Water_Institute' => $with_nids ? 397 : 'Water Institute',
'Western_University' => $with_nids ? 400 : 'Western University',
'Wilfrid_Laurier_University' => $with_nids ? 401 : 'Wilfrid Laurier University',
'UWaterloo_Arts_Stratford_School_Interaction_Design_Business' => $with_nids ? 371 : 'Arts - Stratford School of Interaction Design and Business',
'UWaterloo_Engineering_Conrad_School_of_Entrepreneurship_and_Business' => $with_nids ? 380 : 'Conrad School of Entrepreneurship and Business',
'Arts_Stratford_School_Interaction_Design_Business' => $with_nids ? 371 : 'Arts - Stratford School of Interaction Design and Business',
'Engineering_Conrad_School_of_Entrepreneurship_and_Business' => $with_nids ? 380 : 'Conrad School of Entrepreneurship and Business',
);
// If there is a logo with the key return it,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment