Hi,
As I needed the plugin/template child feature for one of my project, I
tried to fix #936 this week-end (see patch joined to the ticket entry).
It seems to work fine for the moment, but I encountered a strange issue
when
generating the sql (through mysql exporter).
For the wiki example of the documentation (or the Plugin_Testcase), I
get the following sql for the WikiTranslation table:
ALTER TABLE wiki_translation ADD FOREIGN KEY (id, lang) REFERENCES wiki_translation_version(id, lang);
ALTER TABLE wiki_translation ADD FOREIGN KEY (id, lang) REFERENCES wiki_translation_index(id, lang);
ALTER TABLE wiki_translation_version ADD FOREIGN KEY (id, lang) REFERENCES wiki_translation(id, lang) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE wiki_translation_index ADD FOREIGN KEY (id, lang) REFERENCES wiki_translation(id, lang) ON UPDATE CASCADE ON DELETE CASCADE;
The last 2 alter tables are OK (created by each child of i18n plugin), but the first 2 are plain wrong.
Those first 2 are coming from the
Doctrine_Record_Generator::buildForeignKeys that is called from
Doctrine_Record_Generator::initialize for the i18n plugin.
So the question is: what is the purpose of Doctrine_Record_Generator::buildForeignKeys?
Reading the source code of buildForeignKeys, I don't understand what it is doing?
Especially when some plugins are calling buildForeighKeys by themselves
(like i18n), I don't see the point of calling this function for every
plugin that initialize.
Any idea on how to fix that?