http://forum.joomla.org/index.php/topic,256131.0.html
Lets take a look into the code administrator\components\com_content\controller.php.
Line 384 says:
Code: Select all
if ($id)
{
$row->checkout($user->get('id'));
if (trim($row->images)) {
$row->images = explode("\n", $row->images);
} else {
$row->images = array ();
}
$query = 'SELECT name' .
' FROM #__users'.
' WHERE id = '. (int) $row->created_by;
$db->setQuery($query);
$row->creator = $db->loadResult();
// test to reduce unneeded query
if ($row->created_by == $row->modified_by) {
$row->modifier = $row->creator;
} else {
$query = 'SELECT name' .
' FROM #__users' .
' WHERE id = '. (int) $row->modified_by;
$db->setQuery($query);
$row->modifier = $db->loadResult();
}
$query = 'SELECT COUNT(content_id)' .
' FROM #__content_frontpage' .
' WHERE content_id = '. (int) $row->id;
$db->setQuery($query);
$row->frontpage = $db->loadResult();
if (!$row->frontpage) {
$row->frontpage = 0;
}
}
else
{
if (!$sectionid && JRequest::getInt('filter_sectionid')) {
$sectionid =JRequest::getInt('filter_sectionid');
}
if (JRequest::getInt('catid'))
{
$row->catid = JRequest::getInt('catid');
$category = & JTable::getInstance('category');
$category->load($row->catid);
$sectionid = $category->section;
} else {
$row->catid = NULL;
}
jimport('joomla.utilities.date');
$createdate = new JDate();
$row->sectionid = $sectionid;
$row->version = 0;
$row->state = 1;
$row->ordering = 0;
$row->images = array ();
$row->publish_up = $createdate->toUnix();
$row->publish_down = JText::_('Never');
$row->creator = '';
$row->created = $createdate->toUnix();
$row->modified = $nullDate;
$row->modifier = '';
$row->frontpage = 0;
}
Line 559 says:
Code: Select all
if (JHTML::_('date', $row->publish_down, '%Y') <= 1969 || $row->publish_down == $db->getNullDate()) {
$form->set('publish_down', JText::_('Never'));
} else {
$form->set('publish_down', JHTML::_('date', $row->publish_down, '%Y-%m-%d %H:%M:%S'));
}
At this time $row->publish_down is "Never" if the article does not exist. The first line seems to work on most systems even if there are no compatible types, but maybe not everywhere.
This could be a reason for this problem. I think the following addition should fix this problem.
Code: Select all
if (JHTML::_('date', $row->publish_down, '%Y') <= 1969 || $row->publish_down == $nullDate /* method call not necessary */ || strcmp($row->publish_down, JText::_('Never')) == 0) {
$form->set('publish_down', JText::_('Never'));
} else {
$form->set('publish_down', JHTML::_('date', $row->publish_down, '%Y-%m-%d %H:%M:%S'));
}