Assegnazione url corretto alla singola circolare
This commit is contained in:
@ -21,7 +21,7 @@ use \Joomla\CMS\Helper\TagsHelper;
|
||||
use \Joomla\CMS\Filter\OutputFilter;
|
||||
use \Joomla\CMS\Event\Model;
|
||||
use Joomla\CMS\Event\AbstractEvent;
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
|
||||
|
||||
/**
|
||||
@ -127,6 +127,14 @@ class CircolareModel extends AdminModel
|
||||
$data = $this->item;
|
||||
}
|
||||
|
||||
if ((is_array($data) && empty($data['id'])) || (is_object($data) && empty($data->id))) {
|
||||
if (is_array($data)) {
|
||||
$data['catid'] = (int)($data['catid'] ?? 0) ?: 11;
|
||||
} else {
|
||||
$data->catid = (int)($data->catid ?? 0) ?: 11;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@ class CircolareTable extends Table implements VersionableTableInterface, Taggabl
|
||||
$this->ordering = self::getNextOrder();
|
||||
}
|
||||
|
||||
// Ordering per nuovi record
|
||||
// Ordering per nuovi record
|
||||
if (property_exists($this, 'ordering') && (int) $this->id === 0) {
|
||||
$this->ordering = self::getNextOrder();
|
||||
}
|
||||
@ -235,6 +235,11 @@ class CircolareTable extends Table implements VersionableTableInterface, Taggabl
|
||||
}
|
||||
|
||||
|
||||
// Default categoria (nuovi record o catid non impostato)
|
||||
$this->catid = (int)($this->catid ?? 0) ?: 11;
|
||||
|
||||
|
||||
|
||||
return parent::check();
|
||||
}
|
||||
|
||||
@ -313,5 +318,4 @@ class CircolareTable extends Table implements VersionableTableInterface, Taggabl
|
||||
$this->_db->setQuery($q);
|
||||
return ((int) $this->_db->loadResult()) > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user