? ? Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
19 Aug 2018

Pull Request for Issue #21533 .

Summary of Changes

Read the archived functionallity in the frontend

Testing Instructions

Create an archived link and the archived module
Check and compare the functionality with J! 3

avatar bembelimen bembelimen - open - 19 Aug 2018
avatar bembelimen bembelimen - change - 19 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Aug 2018
Category Front End com_content Language & Strings Modules
avatar bembelimen bembelimen - change - 19 Aug 2018
Title
Readd archived in the frontend
Readd archive in the frontend
avatar bembelimen bembelimen - edited - 19 Aug 2018
avatar bembelimen bembelimen - change - 19 Aug 2018
Labels Added: ? ?
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Aug 2018
Title
Readd archive in the frontend
[4.0] Readd archive in the frontend
avatar joomla-cms-bot joomla-cms-bot - edited - 19 Aug 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

changed Title to show its about 4.0.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21701.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

changed Title to show its about 4.0.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21701.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 19 Aug 2018 - Tested unsuccessfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

I have tested this item ? unsuccessfully on b47a83e

After PR applied got Undefined class constant 'CONDITION_ARCHIVED'

screen shot 2018-08-19 at 07 34 26


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21701.
avatar brianteeman brianteeman - change - 19 Aug 2018
Title
[4.0] Readd archive in the frontend
[4.0] Re-add archive in the frontend
avatar brianteeman brianteeman - edited - 19 Aug 2018
avatar chmst
chmst - comment - 19 Aug 2018

@franz-wohlkoenig - where did you get this error? I am testing right now and cannot reproduce this Messsage.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21701.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018
avatar bembelimen
bembelimen - comment - 19 Aug 2018

@franz-wohlkoenig could you please activate the debug mode to see the exact position of the error?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

@bembelimen Debug Mode is activated now.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_content
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Content\Administrator\Extension;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Association\AssociationServiceTrait;
use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Categories\CategoriesServiceInterface;
use Joomla\CMS\Categories\CategoriesServiceTrait;
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Form\Form;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\CMS\MVC\Factory\MVCFactoryServiceTrait;
use Joomla\CMS\MVC\Factory\MVCFactoryServiceInterface;
use Joomla\CMS\Workflow\WorkflowServiceInterface;
use Joomla\Component\Content\Administrator\Helper\ContentHelper;
use Joomla\Component\Content\Administrator\Service\HTML\AdministratorService;
use Joomla\Component\Content\Administrator\Service\HTML\Icon;
use Psr\Container\ContainerInterface;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;

/**
 * Component class for com_content
 *
 * @since  __DEPLOY_VERSION__
 */
class ContentComponent extends MVCComponent implements
	BootableExtensionInterface, MVCFactoryServiceInterface, CategoriesServiceInterface, FieldsServiceInterface,
	AssociationServiceInterface, WorkflowServiceInterface
{
	use CategoriesServiceTrait;
	use AssociationServiceTrait;
	use HTMLRegistryAwareTrait;

	/**
	 * Booting the extension. This is the function to set up the environment of the extension like
	 * registering new class loaders, etc.
	 *
	 * If required, some initial set up can be done from services of the container, eg.
	 * registering HTML services.
	 *
	 * @param   ContainerInterface  $container  The container
	 *
	 * @return  void
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public function boot(ContainerInterface $container)
	{
		$this->getRegistry()->register('contentadministrator', new AdministratorService);
		$this->getRegistry()->register('contenticon', new Icon($container->get(SiteApplication::class)));

		// The layout joomla.content.icons does need a general icon service
		$this->getRegistry()->register('icon', $this->getRegistry()->getService('contenticon'));
	}

	/**
	 * Returns a valid section for the given section. If it is not valid then null
	 * is returned.
	 *
	 * @param   string  $section  The section to get the mapping for
	 * @param   object  $item     The item
	 *
	 * @return  string|null  The new section
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public function validateSection($section, $item = null)
	{
		if (Factory::getApplication()->isClient('site'))
		{
			// On the front end we need to map some sections
			switch ($section)
			{
				// Editing an article
				case 'form':

					// Category list view
				case 'featured':
				case 'category':
					$section = 'article';
			}
		}

		if ($section != 'article')
		{
			// We don't know other sections
			return null;
		}

		return $section;
	}

	/**
	 * Returns valid contexts
	 *
	 * @return  array
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public function getContexts(): array
	{
		Factory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR);

		$contexts = array(
			'com_content.article'    => Text::_('COM_CONTENT'),
			'com_content.categories' => Text::_('JCATEGORY')
		);

		return $contexts;
	}

	/**
	 * Returns the table for the count items functions for the given section.
	 *
	 * @param   string  $section  The section
	 *
	 * @return  string|null
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	protected function getTableNameForSection(string $section = null)
	{
		return '#__content';
	}

	/**
	 * Method to filter transitions by given id of state.
	 *
	 * @param   array  $transitions  The Transitions to filter
	 * @param   int    $pk           Id of the state
	 *
	 * @return  array
	 *
	 * @since  __DEPLOY_VERSION__
	 */
	public function filterTransitions($transitions, $pk): array
	{
		return ContentHelper::filterTransitions($transitions, $pk);
	}

	/**
	 * Adds Count Items for Category Manager.
	 *
	 * @param   \stdClass[]  $items    The category objects
	 * @param   string       $section  The section
	 *
	 * @return  void
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public function countItems(array $items, string $section)
	{
		return ContentHelper::countItems($items);
	}

	/**
	 * Adds Count Items for Tags Manager.
	 *
	 * @param   \stdClass[]  $items    The tag objects
	 * @param   string       $section  The section
	 *
	 * @return  void
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public function countTagItems(array $items, string $section)
	{
		return ContentHelper::countTagItems($items, $section);
	}

	/**
	 * Prepares the category form
	 *
	 * @param   Form          $form  The form to prepare
	 * @param   array|object  $data  The form data
	 *
	 * @return void
	 */
	public function prepareForm(Form $form, $data)
	{
		ContentHelper::onPrepareForm($form, $data);
	}

	/**
	 * Method to change state of multiple ids
	 *
	 * @param   array  $pks        Array of IDs
	 * @param   int    $condition  Condition of the workflow state
	 *
	 * @return  boolean
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public static function updateContentState($pks, $condition): bool
	{
		return ContentHelper::updateContentState($pks, $condition);
	}
}

avatar bembelimen
bembelimen - comment - 19 Aug 2018

Looks like you have an outdated version?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2018

ah, so its same as joomla/joomla-websites#1207

Sorry for wasting Time.

avatar brianteeman brianteeman - test_item - 19 Aug 2018 - Tested successfully
avatar brianteeman
brianteeman - comment - 19 Aug 2018

I have tested this item successfully on a825af4

As far as I can tell all is good with this and the default workflow


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21701.

avatar wilsonge wilsonge - change - 20 Aug 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-08-20 18:36:03
Closed_By wilsonge
avatar wilsonge wilsonge - close - 20 Aug 2018
avatar wilsonge wilsonge - merge - 20 Aug 2018
avatar wilsonge
wilsonge - comment - 20 Aug 2018

Thanks guys!

avatar infograf768
infograf768 - comment - 31 Aug 2018

@bembelimen
While correcting ContentHelperRoute::getCategoryRoute() to always use the $language variable in #21916 , I do not use catslug anymore.

Has this any unwanted effect on this pr here $query->select($this->getSlugColumn($query, 'c.id', 'c.alias') . ' AS catslug');

I mean should it be modified to use AS catid ?

Add a Comment

Login with GitHub to post a comment