the leftandright module has an amazing technique to replace core taxonomy that can be easily copy-pasted:
http://drupalcode.org/project/leftandright.git/blob/refs/heads/7.x-1.x:/...
http://drupal.org/project/leftandright

Comments

gielfeldt’s picture

Status: Active » Postponed

I'm familiar with the module and the technique doesn't sit well with me. I investigated it previously, and self-modifying code like this feels a bit hackish to me.

geek-merlin’s picture

i really share this feeling.
patching core is a maintainance nightmare otoh.
think it should be an optional module.

gielfeldt’s picture

The problem is, that I don't think it's possible to make it optional. Leftandright contains the file taxonomy.module. This means that it overrides the core taxonomy.module entirely, regardless of the leftandright module being enabled. Yes it reverts to the core taxonomy module functionality through the self-modifying code part and the eval(), but completely optional is not possible. I wish Drupal had better options of overriding core modules.

geek-merlin’s picture

you are right.
> I wish Drupal had better options of overriding core modules.
this is what it boils down to.

we might take our darkest glasses and hackishly alter system.table???
i'll investigate that.

gielfeldt’s picture

FYI :-)

http://drupal.org/sandbox/gielfeldt/1546970

/me having fun hacking Drupal ...

geek-merlin’s picture

hook_core_override_info() - really cool!

you should definitely add a dependency to http://drupal.org/project/bad_judgement

;-)

gielfeldt’s picture

we might take our darkest glasses and hackishly alter system.table???
i'll investigate that.

BTW, the first versions of Core Override did exactly this, but it wasn't very reliable in all cases. I had to use dark magic to inject code when I wanted to rebuild the system table.

Check out the use of class CoreOverrideCodeInjector in http://drupalcode.org/sandbox/gielfeldt/1546970.git/tree/0e8307c to see how to pratice the arts of dark magic :-)

gielfeldt’s picture

Status: Postponed » Fixed

Since the options for overriding core-modules are a bit scarse, short of cloning the taxonomy module and doing search/replace in the code, I consider this task for either fixed (using core override module, as it uses that particular technique) or won't fix.

Status: Fixed » Closed (fixed)

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