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

Rick Romero rick at havokmon.com
Fri Dec 10 19:29:38 UTC 2010


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]);

It seems like the types get cached somehow, 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.

Rick


More information about the dev mailing list