1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XFCP_ : What does it mean and how do I find redeclare error?

Discussion in 'XenForo Development Discussions' started by LPH, Nov 11, 2014.

  1. LPH

    LPH Well-Known Member

    First, I'm working with an add-on that tosses a cannot redeclare XFCP_ when the add-on is enabled. Since there is no XFCP directory, I'm trying to figure out what this even means. I see it in numerous add-ons to extend a class.

    Second, since the error is a redeclaration, I've searched all of the other add-ons for a similar set of code but don't see any. What other ideas can help me track down why there is a redeclaration error?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Jeremy and LPH like this.
  3. LPH

    LPH Well-Known Member

    As always Chris - thank you. Now to figure out what is happening :)
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Another pretty easy mistake to make is doing something like this in a load class controller listener:

    PHP:
    $extend[] = 'The_Extending_Class';
    Without using an event hint (recommended) or wrapping it in a conditional to restrict it to a single class.
     
    Aayush likes this.
  5. LPH

    LPH Well-Known Member

    This is probably it. The $extend is not wrapped in the listener.
     
  6. LPH

    LPH Well-Known Member

    I should correct myself. The issue was in the WordPress widget I wrote a few months ago.
     

Share This Page