Skip to content

Commit

Permalink
added detection for "slug" field for a base_posts_model as well as th…
Browse files Browse the repository at this point in the history
…e record_class being specfied
  • Loading branch information
daylightstudio committed Nov 16, 2015
1 parent b68378e commit 363bf87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fuel/modules/fuel/models/base_posts_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public function __construct($table = null)
{
if (empty($table)) $table = $this->name;
parent::__construct($table); // table name
$this->record_class = ucfirst($table).'_item';
if (empty($this->record_class)) $this->record_class = ucfirst($table).'_item';

if (!empty($this->has_many['tags']))
{
$this->has_many['tags']['where'] = '(FIND_IN_SET("'.$this->name.'", '.$this->_tables['fuel_tags'].'.context) OR '.$this->_tables['fuel_tags'].'.context="")';
Expand Down Expand Up @@ -86,7 +87,10 @@ public function form_fields($values = array(), $related = array())
$fields =& $fields->get_fields();
}

$fields[$this->slug_field]['size'] = 100;
if (isset($fields['slug']))
{
$fields[$this->slug_field]['size'] = 100;
}

if (isset($fields['title']))
{
Expand Down

0 comments on commit 363bf87

Please sign in to comment.