[campsite-dev] Campsite 3.1.2 is here!
  • Dear all,

    I am pleased to announce that 3.1.2 has been released. Please read the site
    (http://www.campware.org) for the full announcement.

    The release is minor in number, but it is an enticing proposition for those
    of you who haven't upgraded yet from the good old 2.x.

    Please spread the word about the release (Facebook, Twitter, whatever).

    Kudos for the release go primarily to Holman Romero who's worked all his
    waking hours to wrap this one up.

    All the best and sorry for cross-posting.

    Sava
  • 2 Comments sorted by
  • see my previous email

    On Thu, Nov 6, 2008 at 2:20 PM, Sebastian Goebel wrote:

    > Hi,
    >
    > I found this bug, which happens under some circumstances
    > http://code.campware.org/projects/campsite/ticket/2644
    >
    > The reason that it appears is explained here:
    >
    > http://www.bigroom.co.uk/blog/php-nesting-level-too-deep-recursive-dependency
    >
    >
    > Here an code example where it happens (from CampContext.php line 912):
    > private function setArticleHandler(MetaArticle $p_oldArticle,
    > MetaArticle $p_newArticle)
    > {
    > static $articleHandlerRunning = false;
    > if ($articleHandlerRunning || $p_newArticle == $p_oldArticle) {
    > return;
    > }
    > (...)
    > }
    >
    > I am not sure if we can solve it be just changing the comparision operator
    > to the strict one (====). In this case similar MetaArticle objects (same
    > properties, but created twice) will not be found as identical. The article
    > is clear about that:
    > *If, however, we use strict comparison (===), PHP will check whether the
    > two objects are exactly the same object, not just objects with the same
    > properties.
    > *
    > Additionally I tested it by setting an breakpoint to the return
    > statement in line 916. Changing the comparision operator to ===, it will be
    > reached just in an very special case. Check the ticket for the template code
    > which paste identical objects to the method.
    >
    > In deep, I believe the m_contentCache is problematic. It stores article
    > fields, which themself having key m_parent to reference the MetaArticle
    > object again. There it seems is the circular reference. See the attachment.
    >
    > Two solutions I see:
    > 1. The __create method of metaobjects have to take care if an identical
    > object was requested, and just return an reference to that, not creating it
    > again. This would be good for performance too, but I don't know if this
    > causes problems. AFIK MetaObjects are just readable and will not be
    > modified.
    > 2. The comparisions does not compare the whole object, instead just the
    > keys which identify 2 objects as beeing unique. E.g. for article number and
    > language id.
    >
    > Btw, comparing the whole objects key by key sounds ineffective.
    >
    >
    >
    > So, let our scientists speak up.
    >
    > Sebastian
    >
    >
    >