registry_rebuild() does not delete files from modules which do not exist anymore. This doesn't affect anything when the registry is just used as a lookup but things fall apart for example when trying to use SimpleTest.

To reproduce:

- Install/Enable a module with tests and Simpletest
- Remove the module with the .test files
- Try to acess the List of tests: Fatal error wich can only be resolved by manually messing around in the database.

The attached patch manually deletes all such files which don't exist anymore.

CommentFileSizeAuthor
delete_stale_files.patch932 bytesberdir

Comments

berdir’s picture

Status: Active » Needs review
rfay’s picture

Wow, I can recreate that.... But isn't that a catastrophic failure of registry_rebuild()? What am I missing?

Doesn't look like this problem is addressed in #534594: [meta] system info cache writing and registry rebuilding is broken without a full bootstrap either...

Shouldn't registry_rebuild() do "the right thing" here?

rfay’s picture

Should we just plain truncate the registry table the first time around?

sun’s picture

Component: User interface » Code

This actually sounds like it could be fixed directly in core. I'd suggest to move this issue to core, before attempting to work around it here. Or alternatively, commit this patch (looks good to me), and afterwards move the issue, and lastly remove this code when core has been fixed.

rfay’s picture

Thanks, @sun.

rfay’s picture

Status: Needs review » Reviewed & tested by the community

Looks like @sun would RTBC this; I'll commit it later. Probably we should have a separate issue for core.

rfay’s picture

Status: Reviewed & tested by the community » Fixed

Committed with equivalent changes to the PHP script. 0bb419f

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.