mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Fixes #763 - media manager category insert error.
This commit is contained in:
@@ -210,25 +210,31 @@ class media_cat_ui extends e_admin_ui
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
|
|
||||||
|
|
||||||
if($sql->db_Select_gen("SELECT media_cat_owner, count(media_cat_id) as number FROM `#core_media_cat` GROUP BY media_cat_owner"))
|
if($sql->gen("SELECT media_cat_owner, MAX(media_cat_category) as maxnum, count(media_cat_id) as number FROM `#core_media_cat` GROUP BY media_cat_owner"))
|
||||||
{
|
{
|
||||||
while($row = $sql->db_Fetch())
|
while($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
$this->ownerCount[$row['media_cat_owner']] = $row['number'];
|
$this->ownerCount[$row['media_cat_owner']] = $row['number'];
|
||||||
$own = $row['media_cat_owner'];
|
$own = $row['media_cat_owner'];
|
||||||
if(!in_array($own,$restricted))
|
if(!in_array($own,$restricted))
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->fields['media_cat_owner']['writeParms'][$own] = $own;
|
$this->fields['media_cat_owner']['writeParms'][$own] = $own;
|
||||||
|
|
||||||
|
list($tmp,$tmp2,$maxnum) = explode("_",$row['maxnum']); // check for highest value.
|
||||||
|
if($maxnum > 0)
|
||||||
|
{
|
||||||
|
$this->ownerCount[$row['media_cat_owner']] = $maxnum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function createPage()
|
public function createPage()
|
||||||
{
|
{
|
||||||
if(!count($this->fields['media_cat_owner']['writeParms']))
|
if(!count($this->fields['media_cat_owner']['writeParms']))
|
||||||
|
Reference in New Issue
Block a user