Checking deeper into the News module code, I found some potential errors in "function.admin_customfieldstab.php".
The code:
Code: Select all
if( !in_array($row['id'],$usedfields) )
{
$onerow->deletelink = $this->CreateLink($id, 'admin_deletefielddef', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/delete.gif', $this->Lang('delete'),'','','systemicon'), array('fdid'=>$row['id']), $this->Lang('areyousure'));
}
My opinion is that the negation "!" is an error.
After I removed the above negation, another error appeared. The following code from the beginning of the file:
Code: Select all
$tmp = $db->GetArray('SELECT DISTINCT fielddef_id FROM '.cms_db_prefix().'module_news_fieldvals');
$usedfields = array();
foreach( $tmp as $row )
{
$usedfields[] = $row['fielddef_id'];
}
I changed the code like this:
Code: Select all
$tmp = $db->GetArray('SELECT DISTINCT id FROM '.cms_db_prefix().'module_news_fielddefs');
$usedfields = array();
foreach( $tmp as $row )
{
$usedfields[] = $row['id'];
}