Download & Extend

Allow path module to be uninstalled

Project:Drupal core
Version:8.x-dev
Component:path.module
Category:feature request
Priority:normal
Assigned:Dave Reid
Status:needs work

Issue Summary

A number of module tables, like taxonomy, don't need to be in system.install. This bundle of install files splits them out properly. It's a zip file because I have no cvs-fu, and don't know how to make a patch that adds files to core. ;)

AttachmentSizeStatusTest resultOperations
install_patch.zip34.24 KBIgnored: Check issue status.NoneNone

Comments

#1

Added $Id$ and rolled a patch. Thanks Eaton!

AttachmentSizeStatusTest resultOperations
install_files.patch26.78 KBIgnored: Check issue status.NoneNone

#2

Status:active» needs review

Works smashingly, though it does depend on http://drupal.org/node/73615 (a patch htat always forces system.module to install first, no matter what order things appear in).

Without #73615, menu.module tries to install first, before the variables table exists, etc.

So. Commit #73660, then this one. And the installer will be happy.

#3

Version:4.7.2» x.y.z

This is CVS, clearly not 4.7.2

#4

#73615 (dependency) was committed. I'm cool with this patch.

#5

Version:x.y.z» 6.x-dev
Status:needs review» needs work

I have always wanted this, but it's a little late

#6

I have always wanted this, but it's a little late

#7

Version:6.x-dev» 7.x-dev

Now it's too late again... let's get it done in D7!

#8

These are the tables that are created in system.install
- variable
- actions
- actions_aid
- batch
- blocked_ips
- cache
- cache_form
- cache_page
- cache_menu
- cache_registry
- files
- flood
- history
- menu_router
- menu_links
- registry
- registry_file
- sessions
- system
- url_alias

Which are save to move to their respective modules?

#9

Status:needs work» needs review

I'm thinking the only others that can be split is possibly url_alias. Everything else is needed by system.

Patch attached to split url_alias schema into path.install. Tested on fresh HEAD install and upgraded HEAD install.

AttachmentSizeStatusTest resultOperations
73660.path_install.patch4.41 KBIdleFailed: 7199 passes, 4 fails, 0 exceptionsView details | Re-test

#10

Title:Drupal installer: split out more module install files» Split out path.install from system.install

Since there's only one module left to be split out from system.install, renaming the issue. Revised patch with the fetchField() from DBTNG.

AttachmentSizeStatusTest resultOperations
path-install-73660-D7.patch4.42 KBIdleFailed: Failed to apply patch.View details | Re-test

#11

Status:needs review» needs work

The last submitted patch failed testing.

#12

Assigned to:Anonymous» Dave Reid
Status:needs work» needs review

Re-roll.

AttachmentSizeStatusTest resultOperations
73660-path-install-D7.patch4.97 KBIdleFailed: Failed to apply patch.View details | Re-test

#13

Status:needs review» needs work

the $paths_enabled check should be a module_exists('path') - this was tried a while back but had to be reverted because module_list was broken, I think it's less broken now so it should be fine to do now. That'd then save us the COUNT() query altogether since whether path module is enabled is a sufficient check in itself.

#14

Status:needs work» needs review

Yeah I suppose that would be a better check. Easy enough of a fix!

AttachmentSizeStatusTest resultOperations
73660-path-install-D7.patch4.82 KBIdleFailed: 7287 passes, 7 fails, 0 exceptionsView details | Re-test

#15

We can still kill the COUNT() though. I realise this has nothing to do with the purpose of the patch, so leaving at CNR.

#16

Status:needs review» needs work

The last submitted patch failed testing.

#17

Status:needs work» needs review

For some reason, module_exists does not work there. It returns FALSE even though the module is enabled. Switching back to db_table_exists and removing the $count stuff.

AttachmentSizeStatusTest resultOperations
73660-path-install-D7.patch5.16 KBIgnored: Check issue status.NoneNone

#18

Status:needs review» reviewed & tested by the community

hmm, module_list() is still broken then. You left a commented module_exists() check in the patch though. I think this means #12 is RTBC anyway. Sorry for derailment.

#19

Status:reviewed & tested by the community» needs work

#12 no longer applies but #17 applies (with minor fuzz) and installs correctly, path.module enables correctly but trying to uninstall path.module throws an exception:

Fatal error: Exception thrown without a stack frame in Unknown on line 0

#20

Ah watchdog had this to offer:

PDOException: SELECT dst FROM {url_alias} WHERE src = ? AND language IN(?, '') ORDER BY language DESC - Array ( [0] => admin/build/modules/uninstall [1] => en ) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dh.url_alias' doesn't exist in drupal_lookup_path() (line 68 of /Users/amorton/Sites/dh/includes/path.inc).

#21

#22

Title:Split out path.install from system.install» Allow path module to be uninstalled
Component:base system» path.module

#23

Status:needs work» needs review

Gave this a re-roll now that module_exists() looks like it works within drupal_lookup_path(). I tried uninstalling the module and it worked successfully.

AttachmentSizeStatusTest resultOperations
73660-path-install-D7.patch5.32 KBIdleFailed: Failed to apply patch.View details | Re-test

#24

I know it's scope creep, but if module_exists() actually works at that stage, can we pretty please kill the SELECT COUNT(*) in drupal_lookup_path()? If not this at least gets me subscribed so I can revive the old patches which did this.

Everything looks good, so if the test bot says yes, ought to be RTBC.

#25

I guess it's reasonable to assume that we can remove the count query since if the path module is installed, then it's assumed that the user is actually using some url aliases.

#26

There's a small chance that someone has path installed and no aliases, then they'll get lots of no-op queries, but there's a guarantee that every other Drupal site gets the count query on every page request, so overall, it'll be less ;)

#27

Revised patch just using module_exists().

AttachmentSizeStatusTest resultOperations
73660-path-install-D7.patch6.02 KBIdleFailed: Failed to apply patch.View details | Re-test

#28

Status:needs review» needs work

The last submitted patch failed testing.

#29

I'm not sure this patch makes sense because it ties path.inc (an API for having URL aliases) to path.module (one particular user interface for managing them). See the discussion at #196862: COUNT(*) is an expensive query in InnoDB. also.

#30

The function drupal_lookup_path has always been tied to path.module. The {url_alias=} table should have always been tied to the path.module as well and allowed it to be uninstalled. Nothing is being changed in that respect. It's only allowing path.module to be uninstalled.

#31

Looking at the current code for drupal_lookup_path(), I'm having trouble seeing how it is tied to path.module..... in fact, if I disable path.module on existing site, the drupal_lookup_path() function continues to get called, and my previous URL aliases continue to work. To me, that's the expected behavior.

Consider this scenario: Someone wants to write a contrib module that provides a totally different user interface for managing URL aliases. Instead of the long admin screen and the collapsible fieldset on nodes provided by path.module, they want to do it completely differently. Currently, this would work fine -- someone who wants to try out the new module would just disable the core Path module, install the new one, and everything would work OK. However, if this patch goes in, how would they do it? If they disable the core Path module, their URL aliases would all be broken in the meantime. And if they made the mistake of uninstalling the core Path module, then all their URL aliases would be gone forever and they'd have to start completely from scratch.

I kinda do see the utility of a "delete all URL aliases on my site" kind of functionality, but I just don't think it's something that should happen automatically when the Path module is uninstalled. Not the way the Path module currently works, at any rate.

#32

I guess in that scenario, the contrib module might want to provide a different data structure and load it's own 'path_include' variable. I was always in the assumption that if the path module was disabled/uninstalled, then node aliases should not work.

I guess we should get more opinions on which direction to take as far as what should happen when path is disabled/uninstalled.

#33

Subscribing.

#34

Version:7.x-dev» 8.x-dev

Too late for D7. Bumping to D8.

nobody click here