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

Changeset 4517

Show
Ignore:
Timestamp:
01/26/12 07:52:57 (4 months ago)
Author:
tboutell
Message:

Preserve slideshow order. Thanks to metadan. relinkMediaItems now returns the valid ids in order.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/1.5/lib/action/BaseaSlideshowSlotActions.class.php

    r4484 r4517  
    2626    { 
    2727      $ids = preg_split('/,/', $request->getParameter('aMediaIds')); 
    28       $this->relinkMediaItems($ids); 
     28      $links = $this->relinkMediaItems($ids); 
    2929 
    3030      // This isn't a normal form submission, but the act of selecting items for a 
     
    4646   * Drop any existing links to media items and re-link to any valid media item ids 
    4747   * mentioned in $ids. Doctrine is not very good at this, but this solution is 
    48    * battle-tested 
     48   * battle-tested. Return the valid ids in order 
    4949   */ 
    5050  protected function relinkMediaItems($ids) 
     
    5656    $links = aArray::getIds($items); 
    5757    $this->slot->link('MediaItems', $links); 
     58    return $links; 
    5859  } 
    5960