To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #542 (closed defect: fixed)

Opened 18 months ago

Last modified 18 months ago

engine-slug option for aRoute and aDoctrineRoute should not require an additional query

Reported by: dordille Owned by: dordille
Priority: blocker Milestone: 1.5
Component: apostrophePlugin Version:
Keywords: aRoute, aDoctrineRoute Cc:
Symfony version: 1.4

Description

aRoute and aDoctrineRoute both support the engine-slug option however this is impractical to use due to performance hits in fetching the corresponding engine every time a link is made.

From aRouteTools

static public function pushTargetEnginePage($page)
  {
    if (!(is_object($page) && ($page instanceof aPage)))
    {
      $page = aPageTable::retrieveBySlug($page);
    }
    self::$targetEnginePages[$page->engine][] = $page;
  }

addPageToUrl currently expects the targetEnginePages cache to be an array of objects. The solution seems to be to allow the $targetEnginePages cache accept slugs. For backwards compatibility with 1.4 the cache should also allow aPage objects.

Change History

Changed 18 months ago by tboutell

  • owner changed from boutell to tboutell
  • priority changed from major to blocker
  • status changed from new to accepted

Changed 18 months ago by dordille

  • owner changed from tboutell to dordille
  • status changed from accepted to assigned

Changed 18 months ago by dordille

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [2087].

aRouteTools::$targetEnginePages is now an array of page slugs instead of an array of pages.

Changed 18 months ago by tboutell

Awesome!

Is this merged?

Changed 18 months ago by tboutell

Does this allow you to implement your best-engine method?

Note: See TracTickets for help on using tickets.