2014090900-1.9.0-fix_processed_upgrades-183ad189c71872d8.php 848 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Elgg 1.9.0 upgrade 2014090900
  4. * fix_processed_upgrades
  5. *
  6. * Fixes incorrect values in the processed_upgrades setting.
  7. *
  8. * Both the upgrade file name and the class responsible for the actual upgrade
  9. * logic had been set as the value of variable called $upgrade. This mistake may
  10. * have caused the class to be saved to the list of processed upgrade instead
  11. * of the filename. This upgrade replaces the class with the filename.
  12. */
  13. $upgrade_data = datalist_get('processed_upgrades');
  14. $upgrade_data = unserialize($upgrade_data);
  15. foreach ($upgrade_data as $key => $entry) {
  16. if (!$entry instanceof ElggUpgrade) {
  17. continue;
  18. }
  19. if ($entry->title == 'Comments Upgrade') {
  20. $upgrade_data[$key] = '2013010400-1.9.0_dev-comments_to_entities-faba94768b055b08.php';
  21. }
  22. }
  23. datalist_set('processed_upgrades', serialize($upgrade_data));