Skip to content

Commit

Permalink
Merge pull request #2 from Babofett/4.0-dev_content-drafting-david
Browse files Browse the repository at this point in the history
4.0 dev content drafting david
  • Loading branch information
Dako390 committed Aug 24, 2021
2 parents b7c48ff + 17226f0 commit eeed489
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
12 changes: 12 additions & 0 deletions administrator/components/com_content/src/Model/ArticleModel.php
Expand Up @@ -682,6 +682,7 @@ public function validate($form, $data, $group = null)
*
* @since 1.6
*/

public function save($data)
{
$input = Factory::getApplication()->input;
Expand All @@ -694,6 +695,17 @@ public function save($data)
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
}

if(!isset($data['draft']) || $data['state'] != 1)
{
$data['draft'] = 1;
}

if($data['state'] == 1)
{
$data['draft'] = 0;
}


if (isset($data['created_by_alias']))
{
$data['created_by_alias'] = $filter->clean($data['created_by_alias'], 'TRIM');
Expand Down
7 changes: 0 additions & 7 deletions administrator/components/com_menus/presets/default.xml
Expand Up @@ -37,13 +37,6 @@
quicktask="index.php?option=com_categories&extension=com_content&task=category.add"
/>

<menuitem
title="COM_CONTENT_MENUS_DRAFT_MANAGER"
type="component"
element="com_content"
link="index.php?option=com_content&amp;view=articles"
/>

<menuitem
title="COM_CONTENT_MENUS_FEATURED"
type="component"
Expand Down
2 changes: 2 additions & 0 deletions components/com_content/src/Model/ArticlesModel.php
Expand Up @@ -230,6 +230,8 @@ protected function getListQuery()
$db->quoteName('a.metakey'),
$db->quoteName('a.metadesc'),
$db->quoteName('a.access'),
$db->quoteName('a.draft'),
$db->quoteName('a.shared'),
$db->quoteName('a.hits'),
$db->quoteName('a.featured'),
$db->quoteName('a.language'),
Expand Down

0 comments on commit eeed489

Please sign in to comment.