Page MenuHomePhabricator

Course can be undeleted without undeleting its organization
Closed, ResolvedPublic

Description

If an organization gets deleted, all associated courses are deleted along with it. A course can then be undeleted without restoring the organization. This results in a warning stack track that obscures much of the interface, like this:

Warning: array_key_exists(): The first argument should be either a string or an integer in /vagrant/mediawiki/extensions/EducationProgram/includes/actions/ViewCourseAction.php on line 55 Call Stack: 0.0008 645240 1. {main}() /vagrant/mediawiki/index.php:0 0.1446 14297928 2. MediaWiki->run() /vagrant/mediawiki/index.php:49 0.1447 14297928 3. MediaWiki->main() /vagrant/mediawiki/includes/Wiki.php:460 0.2181 21129312 4. MediaWiki->performRequest() /vagrant/mediawiki/includes/Wiki.php:596 0.2293 22275320 5. MediaWiki->performAction() /vagrant/mediawiki/includes/Wiki.php:305 0.2374 23006616 6. FormlessAction->show() /vagrant/mediawiki/includes/Wiki.php:441 0.2725 25638392 7. EducationProgram\ViewCourseAction->onView() /vagrant/mediawiki/includes/Action.php:567 0.2811 26733376 8. EducationProgram\ViewAction->onView() /vagrant/mediawiki/extensions/EducationProgram/includes/actions/ViewCourseAction.php:105 0.2881 27075080 9. EducationProgram\ViewCourseAction->displayNavigation() /vagrant/mediawiki/extensions/EducationProgram/includes/actions/ViewAction.php:121 0.2988 27306112 10. array_key_exists() /vagrant/mediawiki/extensions/EducationProgram/includes/actions/ViewCourseAction.php:55

It should probably just not be possible to undelete a course without first undeleting the institution. Attempting to undelete it should either prompt the user on whether they want to undelete the org as well (this would be better), or just indicate that it cannot be undeleted unless the org is undeleted first (this would be good enough).


Version: master
Severity: normal

Details

Reference
bz57837

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:36 AM
bzimport set Reference to bz57837.

Change 110143 had a related patch set uploaded by AndyRussG:
No undeletion of courses of deleted institutions

https://gerrit.wikimedia.org/r/110143

The undeletion of the institution used to happen automatically. One more regression... really hurting because of the lack of tests I guess :|

andrew.green.df wrote:

Hi...! It's not a regression. There is code for the inverse--when you undelete an institution, the extension does try to re-create the courses that were deleted along with it--but not the other way 'round.