mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Fixed issue where inline editing of a news item could remove other data.
This commit is contained in:
@@ -459,21 +459,27 @@ class news_admin_ui extends e_admin_ui
|
|||||||
|
|
||||||
|
|
||||||
public function beforeUpdate($new_data, $old_data, $id)
|
public function beforeUpdate($new_data, $old_data, $id)
|
||||||
|
{
|
||||||
|
if(!empty($new_data['news_thumbnail']))
|
||||||
{
|
{
|
||||||
$new_data['news_thumbnail'] = $this->processThumbs($new_data['news_thumbnail']);
|
$new_data['news_thumbnail'] = $this->processThumbs($new_data['news_thumbnail']);
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($new_data['news_datestamp']))
|
if(empty($new_data['news_datestamp']))
|
||||||
{
|
{
|
||||||
$new_data['news_datestamp'] = time();
|
$new_data['news_datestamp'] = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($new_data['news_sef']))
|
if(empty($new_data['news_sef']) && !empty($new_data['news_title']))
|
||||||
{
|
{
|
||||||
$new_data['news_sef'] = eHelper::title2sef($new_data['news_title']);
|
$new_data['news_sef'] = eHelper::title2sef($new_data['news_title']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($new_data['news_author']))
|
||||||
|
{
|
||||||
$tmp = explode(chr(35), $new_data['news_author']);
|
$tmp = explode(chr(35), $new_data['news_author']);
|
||||||
$new_data['news_author'] = intval($tmp[0]);
|
$new_data['news_author'] = intval($tmp[0]);
|
||||||
|
}
|
||||||
|
|
||||||
return $new_data;
|
return $new_data;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user