Wednesday, April 7, 2010

You cannot define a correlation name ‘foo’ more than once

This error haunted me last few days ... nothing on net which can indicate source of error, only one supposed solution was commenting out one line somewhere in core files = big no go for me.
After poking around and comparing why default themes work and mine don't even they functionally are the same I finally stumbled into real culprit
<action method="unsetChild">
As this is used to remove block "content" so one can add another in his place (as opposite to <remove name="foo"> which removes block entirely from XML) I used it to remove and re-create layered navigation so I can change order of blocks but...
Surely unsetChild will remove it but as far I can see original block will be still executed (I should known better fighting with other "logical" and "user configurable" decisions in magento before) - so with my code
<action method="unsetChild"><name>foo</name></action>
<block name="foo" ... />
I managed to call filtering function more than once which in turn produced error from title.
where I left my "bang head here" sticker...

P.S. granted I'm very new to magento so I maybe just made just plain ol' PEBKAC (or better yet ID10T error :P) who knows ...

P.P.S to paraphrase Jamie Zawinski:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
on this case
Some people, when confronted with a problem, think "I know, I'll use XML." Now they have a LOT of trouble.

5 comments:

  1. Thx for the hint, that really helped me out.
    We're migrating magento 1.6 to 1.9 and ran into that issue. Still I don't get if this is a feature or a bug. The Layout command just doesn't work so I had to delete the block that I don't want to have. The unsetChild command wasn't working either for me.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. To fix this problem just make sure there is only 1 line with in your catalog.xml file and that line should be only shown by --
    Category layered navigation layout
    -- and no where else.

    ReplyDelete
  4. thanks a lot for pointing me into the right direction. :-)

    ReplyDelete
  5. THANK you!! really thought I had broken something badly for a while

    ReplyDelete