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

Show
Ignore:
Timestamp:
04/26/10 16:26:04 (2 years ago)
Author:
dordille
Message:

Editing a blog slug now works as designed, this fixes #206.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheBlogPlugin/trunk/lib/model/doctrine/PluginaBlogItem.class.php

    r1046 r1062  
    1212 */ 
    1313abstract class PluginaBlogItem extends BaseaBlogItem 
    14  
     14{ 
     15  protected $update = true; 
     16 
    1517  /** 
    1618   * These date methods are use in the routing of the permalink 
     
    5153    $this->slug = 'untitled-'.$this['id']; 
    5254    $this->title = 'untitled'; 
     55    $this['slug_saved'] = false; 
     56    $this->update = false; 
    5357    $this->save(); 
     58  } 
     59 
     60  public function preUpdate($event) 
     61  { 
     62    if($this->update) 
     63    { 
     64      if(array_key_exists('slug', $this->getModified())) 
     65      { 
     66        $this['slug_saved'] = true; 
     67      } 
     68      if($this['slug_saved'] == false) 
     69      { 
     70        $this['slug'] = aTools::slugify($this['title']); 
     71      } 
     72    } 
    5473  } 
    5574