[dev] 4.0-git Kronolith (& Ansel) & ensureTypes()

Rick Romero rick at havokmon.com
Sat Dec 18 16:29:35 UTC 2010


Quoting Michael J Rubinsky <mrubinsk at horde.org>:
>> On Dec 18, 2010, at 9:57 AM, Rick Romero <rick at havokmon.com> wrote:
>   >
>   >> Quoting "Michael J.Rubinsky" <mrubinsk at horde.org>:
>   >>>> Quoting Rick Romero <rick at havokmon.com>:
>   >>>  >
>   >>>  >> I'm having an odd issue that cropped up a couple weeks ago.
>   >>>  >>
>   >>>  >> When I goto Kronolith, I immediaetly get the error:
>   >>>  >>
>   >>>  >> QUERY FAILED: DUPLICATE ENTRY 'CALENDAR' FOR KEY 2 INSERT INTO
>   >>>  >> `RAMPAGE_TYPES` (TYPE_NAME) VALUES ('CALENDAR')
>   >>>  >>
>   >>>  >> The enries already exist.  Looking through the code, ansel  
> also does a
>   >>>  >> check against ensureTypes - but it does it under Tags  
> after you view a
>   >>>  >> gallery, so it's not as obvious.
>   >>>  >>
>   >>>  >> I tracked it to:  horde/content/lib/Types/Manager.php  
> around line 72:
>   >>>  >>
>   >>>  >>  unset($typeName[$type]);
>   >>>  >>
>   >>>  >> should be
>   >>>  >>
>   >>>  >>  unset($typeName[$id]);
>   >>>  >
>   >>>  > This code is correct as-is.  It's removing a type name that we know
>   >>>  > is present from the list of names to ensure are present.  
> $type should
>   >>>  > be the value of the type_name field from the query above that line.
>   >>>  >
>   >>>  > Some other users were having similar issues that were the  
> result of a
>   >>>  > broken php (one of the db methods was returning the wrong  
> structure).
>   >>>  >  There is a closed bug about this on bugs.horde.org:
>   >>>  > http://bugs.horde.org/ticket/9223
>   >>>  >
>   >>>  >
>   >>>  >
>   >>>  >>
>   >>>  >> It seems like the types get cached somehow,
>   >>>  >
>   >>>  > Yes, they are cached globally for all users since these mappings
>   >>>  > would rarely, if ever change. You need to clear clear your
>   >>>  > Horde_Cache store.
>   >>>  >
>   >>>  >  so trying to revert after it
>   >>>  >> works to get it to fail again has proven difficult... But the
>   >>> above change
>   >>>  >> seems to fix the problem on both Kronolith and Ansel (in the
>   >>> Tags area).
>   >>>  >> All I know for sure is $type is definitely empty in that loop


More information about the dev mailing list