Allow path module to be uninstalled

eaton - July 14, 2006 - 03:54
Project:Drupal
Version:7.x-dev
Component:path.module
Category:feature request
Priority:normal
Assigned:Dave Reid
Status:needs work
Description

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. ;)

AttachmentSize
install_patch.zip34.24 KB

#1

chx - July 14, 2006 - 04:07

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

AttachmentSize
install_files.patch 26.78 KB

#2

eaton - July 14, 2006 - 04:23
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

eaton - July 14, 2006 - 06:08
Version:4.7.2» x.y.z

This is CVS, clearly not 4.7.2

#4

Dries - July 20, 2006 - 19:20

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

#5

dmitrig01 - June 23, 2007 - 17:25
Version:x.y.z» 6.x-dev
Status:needs review» needs work

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

#6

dmitrig01 - June 23, 2007 - 17:25

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

#7

Pancho - January 31, 2008 - 18:56
Version:6.x-dev» 7.x-dev

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

#8

maartenvg - September 15, 2008 - 14:48

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

Dave Reid - September 15, 2008 - 15:48
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.

AttachmentSize
73660.path_install.patch 4.41 KB
Testbed results
73660.path_install.patchfailedFailed: 7199 passes, 4 fails, 0 exceptions a href=http://testing.drupal.org/pifr/file/1/73660.path_install.patchDetailed results/a

#10

Dave Reid - October 11, 2008 - 02:26
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.

AttachmentSize
path-install-73660-D7.patch 4.42 KB
Testbed results
path-install-73660-D7.patchfailedFailed: Failed to apply patch. a href=http://testing.drupal.org/pifr/file/1/path-install-73660-D7.patchDetailed results/a

#11

System Message - November 16, 2008 - 21:45
Status:needs review» needs work

The last submitted patch failed testing.

#12

Dave Reid - November 17, 2008 - 03:53
Assigned to:Anonymous» Dave Reid
Status:needs work» needs review

Re-roll.

AttachmentSize
73660-path-install-D7.patch 4.97 KB
Testbed results
73660-path-install-D7.patchfailedFailed: Failed to apply patch. a href=http://testing.drupal.org/pifr/file/1/73660-path-install-D7.patchDetailed results/a

#13

catch - November 19, 2008 - 14:55
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

Dave Reid - November 19, 2008 - 17:28
Status:needs work» needs review

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

AttachmentSize
73660-path-install-D7.patch 4.82 KB
Testbed results
73660-path-install-D7.patchfailedFailed: 7287 passes, 7 fails, 0 exceptions Detailed results

#15

catch - November 19, 2008 - 18:08

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

System Message - November 19, 2008 - 18:25
Status:needs review» needs work

The last submitted patch failed testing.

#17

Dave Reid - November 19, 2008 - 19:31
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.

AttachmentSize
73660-path-install-D7.patch 5.16 KB

#18

catch - November 19, 2008 - 19:27
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

drewish - November 24, 2008 - 09:03
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

drewish - November 24, 2008 - 09:05

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

Dave Reid - January 6, 2009 - 21:40

#22

Dave Reid - January 21, 2009 - 15:40
Title:Split out path.install from system.install» Allow path module to be uninstalled
Component:base system» path.module

#23

Dave Reid - February 12, 2009 - 19:48
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.

AttachmentSize
73660-path-install-D7.patch 5.32 KB
Testbed results
73660-path-install-D7.patchfailedFailed: Failed to apply patch. Detailed results

#24

catch - February 12, 2009 - 20:33

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

Dave Reid - February 12, 2009 - 20:45

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

catch - February 12, 2009 - 20:51

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

Dave Reid - February 12, 2009 - 20:56

Revised patch just using module_exists().

AttachmentSize
73660-path-install-D7.patch 6.02 KB
Testbed results
73660-path-install-D7.patchfailedFailed: Failed to apply patch. Detailed results

#28

System Message - February 20, 2009 - 11:55
Status:needs review» needs work

The last submitted patch failed testing.

#29

David_Rothstein - February 21, 2009 - 18:20

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

Dave Reid - February 21, 2009 - 18:47

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

David_Rothstein - February 21, 2009 - 20:54

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

Dave Reid - February 22, 2009 - 18:20

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

Xano - April 2, 2009 - 13:45

Subscribing.

 
 

Drupal is a registered trademark of Dries Buytaert.